Skip to content
Snippets Groups Projects
Commit 77053a6c authored by Robert Speicher's avatar Robert Speicher
Browse files

Convert to RSpec3 syntax via transpec

Command:

    transpec -c 'bundle exec rspec spec -t ~feature' \
    -o should,oneliner,should_receive
parent 74b995d1
No related branches found
No related tags found
No related merge requests found
Showing
with 191 additions and 191 deletions
Loading
@@ -16,7 +16,7 @@ require 'spec_helper'
Loading
@@ -16,7 +16,7 @@ require 'spec_helper'
   
describe SlackService do describe SlackService do
describe "Associations" do describe "Associations" do
it { should belong_to :project } it { is_expected.to belong_to :project }
end end
   
describe "Validations" do describe "Validations" do
Loading
@@ -25,7 +25,7 @@ describe SlackService do
Loading
@@ -25,7 +25,7 @@ describe SlackService do
subject.active = true subject.active = true
end end
   
it { should validate_presence_of :webhook } it { is_expected.to validate_presence_of :webhook }
end end
end end
   
Loading
@@ -52,7 +52,7 @@ describe SlackService do
Loading
@@ -52,7 +52,7 @@ describe SlackService do
slack.execute(build) slack.execute(build)
SlackNotifierWorker.drain SlackNotifierWorker.drain
   
WebMock.should have_requested(:post, webhook_url).once expect(WebMock).to have_requested(:post, webhook_url).once
end end
end end
end end
Loading
@@ -30,21 +30,21 @@ require 'spec_helper'
Loading
@@ -30,21 +30,21 @@ require 'spec_helper'
describe Project do describe Project do
subject { FactoryGirl.build :project } subject { FactoryGirl.build :project }
   
it { should have_many(:commits) } it { is_expected.to have_many(:commits) }
   
it { should validate_presence_of :name } it { is_expected.to validate_presence_of :name }
it { should validate_presence_of :timeout } it { is_expected.to validate_presence_of :timeout }
it { should validate_presence_of :default_ref } it { is_expected.to validate_presence_of :default_ref }
   
describe 'before_validation' do describe 'before_validation' do
it 'should set an random token if none provided' do it 'should set an random token if none provided' do
project = FactoryGirl.create :project_without_token project = FactoryGirl.create :project_without_token
project.token.should_not eq "" expect(project.token).not_to eq ""
end end
   
it 'should not set an random toke if one provided' do it 'should not set an random toke if one provided' do
project = FactoryGirl.create :project project = FactoryGirl.create :project
project.token.should eq "iPWx6WM4lhHNedGfBpPJNP" expect(project.token).to eq "iPWx6WM4lhHNedGfBpPJNP"
end end
end end
   
Loading
@@ -57,7 +57,7 @@ describe Project do
Loading
@@ -57,7 +57,7 @@ describe Project do
FactoryGirl.create :commit, committed_at: 1.hour.ago, project: newest_project FactoryGirl.create :commit, committed_at: 1.hour.ago, project: newest_project
FactoryGirl.create :commit, committed_at: 2.hour.ago, project: oldest_project FactoryGirl.create :commit, committed_at: 2.hour.ago, project: oldest_project
   
described_class.ordered_by_last_commit_date.should eq [newest_project, oldest_project, project_without_commits] expect(described_class.ordered_by_last_commit_date).to eq [newest_project, oldest_project, project_without_commits]
end end
end end
   
Loading
@@ -70,26 +70,26 @@ describe Project do
Loading
@@ -70,26 +70,26 @@ describe Project do
FactoryGirl.create(:build, commit: commit) FactoryGirl.create(:build, commit: commit)
end end
   
it { project.status.should eq 'pending' } it { expect(project.status).to eq 'pending' }
it { project.last_commit.should be_kind_of(Commit) } it { expect(project.last_commit).to be_kind_of(Commit) }
it { project.human_status.should eq 'pending' } it { expect(project.human_status).to eq 'pending' }
end end
end end
   
describe '#email_notification?' do describe '#email_notification?' do
it do it do
project = FactoryGirl.create :project, email_add_pusher: true project = FactoryGirl.create :project, email_add_pusher: true
project.email_notification?.should eq true expect(project.email_notification?).to eq true
end end
   
it do it do
project = FactoryGirl.create :project, email_add_pusher: false, email_recipients: 'test tesft' project = FactoryGirl.create :project, email_add_pusher: false, email_recipients: 'test tesft'
project.email_notification?.should eq true expect(project.email_notification?).to eq true
end end
   
it do it do
project = FactoryGirl.create :project, email_add_pusher: false, email_recipients: '' project = FactoryGirl.create :project, email_add_pusher: false, email_recipients: ''
project.email_notification?.should eq false expect(project.email_notification?).to eq false
end end
end end
   
Loading
@@ -98,28 +98,28 @@ describe Project do
Loading
@@ -98,28 +98,28 @@ describe Project do
project = FactoryGirl.create :project, email_add_pusher: true project = FactoryGirl.create :project, email_add_pusher: true
allow(project).to receive(:broken?).and_return(true) allow(project).to receive(:broken?).and_return(true)
allow(project).to receive(:success?).and_return(true) allow(project).to receive(:success?).and_return(true)
project.broken_or_success?.should eq true expect(project.broken_or_success?).to eq true
} }
   
it { it {
project = FactoryGirl.create :project, email_add_pusher: true project = FactoryGirl.create :project, email_add_pusher: true
allow(project).to receive(:broken?).and_return(true) allow(project).to receive(:broken?).and_return(true)
allow(project).to receive(:success?).and_return(false) allow(project).to receive(:success?).and_return(false)
project.broken_or_success?.should eq true expect(project.broken_or_success?).to eq true
} }
   
it { it {
project = FactoryGirl.create :project, email_add_pusher: true project = FactoryGirl.create :project, email_add_pusher: true
allow(project).to receive(:broken?).and_return(false) allow(project).to receive(:broken?).and_return(false)
allow(project).to receive(:success?).and_return(true) allow(project).to receive(:success?).and_return(true)
project.broken_or_success?.should eq true expect(project.broken_or_success?).to eq true
} }
   
it { it {
project = FactoryGirl.create :project, email_add_pusher: true project = FactoryGirl.create :project, email_add_pusher: true
allow(project).to receive(:broken?).and_return(false) allow(project).to receive(:broken?).and_return(false)
allow(project).to receive(:success?).and_return(false) allow(project).to receive(:success?).and_return(false)
project.broken_or_success?.should eq false expect(project.broken_or_success?).to eq false
} }
end end
   
Loading
@@ -128,14 +128,14 @@ describe Project do
Loading
@@ -128,14 +128,14 @@ describe Project do
let(:parsed_project) { described_class.parse(project_dump) } let(:parsed_project) { described_class.parse(project_dump) }
   
it { parsed_project.should be_valid } it { expect(parsed_project).to be_valid }
it { parsed_project.should be_kind_of(described_class) } it { expect(parsed_project).to be_kind_of(described_class) }
it { parsed_project.name.should eq("GitLab / api.gitlab.org") } it { expect(parsed_project.name).to eq("GitLab / api.gitlab.org") }
it { parsed_project.gitlab_id.should eq(189) } it { expect(parsed_project.gitlab_id).to eq(189) }
it { parsed_project.gitlab_url.should eq("http://demo.gitlab.com/gitlab/api-gitlab-org") } it { expect(parsed_project.gitlab_url).to eq("http://demo.gitlab.com/gitlab/api-gitlab-org") }
   
it "parses plain hash" do it "parses plain hash" do
described_class.parse(project_dump).name.should eq("GitLab / api.gitlab.org") expect(described_class.parse(project_dump).name).to eq("GitLab / api.gitlab.org")
end end
end end
   
Loading
@@ -143,43 +143,43 @@ describe Project do
Loading
@@ -143,43 +143,43 @@ describe Project do
let(:project) { FactoryGirl.create :project } let(:project) { FactoryGirl.create :project }
subject { project.repo_url_with_auth } subject { project.repo_url_with_auth }
   
it { should be_a(String) } it { is_expected.to be_a(String) }
it { should end_with(".git") } it { is_expected.to end_with(".git") }
it { should start_with(project.gitlab_url[0..6]) } it { is_expected.to start_with(project.gitlab_url[0..6]) }
it { should include(project.token) } it { is_expected.to include(project.token) }
it { should include('gitlab-ci-token') } it { is_expected.to include('gitlab-ci-token') }
it { should include(project.gitlab_url[7..-1]) } it { is_expected.to include(project.gitlab_url[7..-1]) }
end end
   
describe '.search' do describe '.search' do
let!(:project) { FactoryGirl.create(:project, name: "foo") } let!(:project) { FactoryGirl.create(:project, name: "foo") }
   
it { described_class.search('fo').should include(project) } it { expect(described_class.search('fo')).to include(project) }
it { described_class.search('bar').should be_empty } it { expect(described_class.search('bar')).to be_empty }
end end
   
describe '#any_runners' do describe '#any_runners' do
it "there are no runners available" do it "there are no runners available" do
project = FactoryGirl.create(:project) project = FactoryGirl.create(:project)
project.any_runners?.should be_falsey expect(project.any_runners?).to be_falsey
end end
   
it "there is a specific runner" do it "there is a specific runner" do
project = FactoryGirl.create(:project) project = FactoryGirl.create(:project)
project.runners << FactoryGirl.create(:specific_runner) project.runners << FactoryGirl.create(:specific_runner)
project.any_runners?.should be_truthy expect(project.any_runners?).to be_truthy
end end
   
it "there is a shared runner" do it "there is a shared runner" do
project = FactoryGirl.create(:project, shared_runners_enabled: true) project = FactoryGirl.create(:project, shared_runners_enabled: true)
FactoryGirl.create(:shared_runner) FactoryGirl.create(:shared_runner)
project.any_runners?.should be_truthy expect(project.any_runners?).to be_truthy
end end
   
it "there is a shared runner, but they are prohibited to use" do it "there is a shared runner, but they are prohibited to use" do
project = FactoryGirl.create(:project) project = FactoryGirl.create(:project)
FactoryGirl.create(:shared_runner) FactoryGirl.create(:shared_runner)
project.any_runners?.should be_falsey expect(project.any_runners?).to be_falsey
end end
end end
end end
Loading
@@ -43,9 +43,9 @@ describe Runner do
Loading
@@ -43,9 +43,9 @@ describe Runner do
   
before { shared_runner.assign_to(project) } before { shared_runner.assign_to(project) }
   
it { shared_runner.should be_specific } it { expect(shared_runner).to be_specific }
it { shared_runner.projects.should eq [project] } it { expect(shared_runner.projects).to eq [project] }
it { shared_runner.only_for?(project).should be_truthy } it { expect(shared_runner.only_for?(project)).to be_truthy }
end end
   
describe "belongs_to_one_project?" do describe "belongs_to_one_project?" do
Loading
@@ -56,7 +56,7 @@ describe Runner do
Loading
@@ -56,7 +56,7 @@ describe Runner do
project.runners << runner project.runners << runner
project1.runners << runner project1.runners << runner
   
runner.belongs_to_one_project?.should be_falsey expect(runner.belongs_to_one_project?).to be_falsey
end end
   
it "returns true" do it "returns true" do
Loading
@@ -64,7 +64,7 @@ describe Runner do
Loading
@@ -64,7 +64,7 @@ describe Runner do
project = FactoryGirl.create(:project) project = FactoryGirl.create(:project)
project.runners << runner project.runners << runner
   
runner.belongs_to_one_project?.should be_truthy expect(runner.belongs_to_one_project?).to be_truthy
end end
end end
end end
Loading
@@ -17,7 +17,7 @@ require 'spec_helper'
Loading
@@ -17,7 +17,7 @@ require 'spec_helper'
describe Service do describe Service do
   
describe "Associations" do describe "Associations" do
it { should belong_to :project } it { is_expected.to belong_to :project }
end end
   
describe "Mass assignment" do describe "Mass assignment" do
Loading
@@ -40,7 +40,7 @@ describe Service do
Loading
@@ -40,7 +40,7 @@ describe Service do
end end
   
describe '#can_test' do describe '#can_test' do
it { @testable.should eq true } it { expect(@testable).to eq true }
end end
end end
end end
Loading
Loading
Loading
@@ -6,12 +6,12 @@ describe Trigger do
Loading
@@ -6,12 +6,12 @@ describe Trigger do
describe 'before_validation' do describe 'before_validation' do
it 'should set an random token if none provided' do it 'should set an random token if none provided' do
trigger = FactoryGirl.create :trigger_without_token, project: project trigger = FactoryGirl.create :trigger_without_token, project: project
trigger.token.should_not be_nil expect(trigger.token).not_to be_nil
end end
   
it 'should not set an random token if one provided' do it 'should not set an random token if one provided' do
trigger = FactoryGirl.create :trigger, project: project trigger = FactoryGirl.create :trigger, project: project
trigger.token.should eq 'token' expect(trigger.token).to eq 'token'
end end
end end
end end
Loading
@@ -42,13 +42,13 @@ describe User do
Loading
@@ -42,13 +42,13 @@ describe User do
it "returns false for reporter" do it "returns false for reporter" do
allow(@user).to receive(:project_info).and_return(project_with_reporter_access) allow(@user).to receive(:project_info).and_return(project_with_reporter_access)
   
@user.has_developer_access?(1).should be_falsey expect(@user.has_developer_access?(1)).to be_falsey
end end
   
it "returns true for owner" do it "returns true for owner" do
allow(@user).to receive(:project_info).and_return(project_with_owner_access) allow(@user).to receive(:project_info).and_return(project_with_owner_access)
   
@user.has_developer_access?(1).should be_truthy expect(@user.has_developer_access?(1)).to be_truthy
end end
end end
   
Loading
@@ -66,13 +66,13 @@ describe User do
Loading
@@ -66,13 +66,13 @@ describe User do
it "returns projects" do it "returns projects" do
allow_any_instance_of(described_class).to receive(:can_manage_project?).and_return(true) allow_any_instance_of(described_class).to receive(:can_manage_project?).and_return(true)
   
user.authorized_projects.count.should eq 2 expect(user.authorized_projects.count).to eq 2
end end
   
it "empty list if user miss manage permission" do it "empty list if user miss manage permission" do
allow_any_instance_of(described_class).to receive(:can_manage_project?).and_return(false) allow_any_instance_of(described_class).to receive(:can_manage_project?).and_return(false)
   
user.authorized_projects.count.should eq 0 expect(user.authorized_projects.count).to eq 0
end end
end end
   
Loading
@@ -93,8 +93,8 @@ describe User do
Loading
@@ -93,8 +93,8 @@ describe User do
project.runners << runner project.runners << runner
project1.runners << runner1 project1.runners << runner1
   
user.authorized_runners.should include(runner, runner1) expect(user.authorized_runners).to include(runner, runner1)
user.authorized_runners.should_not include(runner2) expect(user.authorized_runners).not_to include(runner2)
end end
end end
end end
Loading
@@ -24,15 +24,15 @@ describe Variable do
Loading
@@ -24,15 +24,15 @@ describe Variable do
   
describe '#value' do describe '#value' do
it 'stores the encrypted value' do it 'stores the encrypted value' do
subject.encrypted_value.should_not be_nil expect(subject.encrypted_value).not_to be_nil
end end
   
it 'stores an iv for value' do it 'stores an iv for value' do
subject.encrypted_value_iv.should_not be_nil expect(subject.encrypted_value_iv).not_to be_nil
end end
   
it 'stores a salt for value' do it 'stores a salt for value' do
subject.encrypted_value_salt.should_not be_nil expect(subject.encrypted_value_salt).not_to be_nil
end end
   
it 'fails to decrypt if iv is incorrect' do it 'fails to decrypt if iv is incorrect' do
Loading
Loading
Loading
@@ -13,22 +13,22 @@ require 'spec_helper'
Loading
@@ -13,22 +13,22 @@ require 'spec_helper'
   
describe WebHook do describe WebHook do
describe "Associations" do describe "Associations" do
it { should belong_to :project } it { is_expected.to belong_to :project }
end end
   
describe "Validations" do describe "Validations" do
it { should validate_presence_of(:url) } it { is_expected.to validate_presence_of(:url) }
   
context "url format" do context "url format" do
it { should allow_value("http://example.com").for(:url) } it { is_expected.to allow_value("http://example.com").for(:url) }
it { should allow_value("https://excample.com").for(:url) } it { is_expected.to allow_value("https://excample.com").for(:url) }
it { should allow_value("http://test.com/api").for(:url) } it { is_expected.to allow_value("http://test.com/api").for(:url) }
it { should allow_value("http://test.com/api?key=abc").for(:url) } it { is_expected.to allow_value("http://test.com/api?key=abc").for(:url) }
it { should allow_value("http://test.com/api?key=abc&type=def").for(:url) } it { is_expected.to allow_value("http://test.com/api?key=abc&type=def").for(:url) }
it { should_not allow_value("example.com").for(:url) } it { is_expected.not_to allow_value("example.com").for(:url) }
it { should_not allow_value("ftp://example.com").for(:url) } it { is_expected.not_to allow_value("ftp://example.com").for(:url) }
it { should_not allow_value("herp-and-derp").for(:url) } it { is_expected.not_to allow_value("herp-and-derp").for(:url) }
end end
end end
   
Loading
@@ -43,18 +43,18 @@ describe WebHook do
Loading
@@ -43,18 +43,18 @@ describe WebHook do
   
it "POSTs to the web hook URL" do it "POSTs to the web hook URL" do
@web_hook.execute(@data) @web_hook.execute(@data)
WebMock.should have_requested(:post, @web_hook.url).once expect(WebMock).to have_requested(:post, @web_hook.url).once
end end
   
it "POSTs the data as JSON" do it "POSTs the data as JSON" do
json = @data.to_json json = @data.to_json
   
@web_hook.execute(@data) @web_hook.execute(@data)
WebMock.should have_requested(:post, @web_hook.url).with(body: json).once expect(WebMock).to have_requested(:post, @web_hook.url).with(body: json).once
end end
   
it "catches exceptions" do it "catches exceptions" do
described_class.should_receive(:post).and_raise("Some HTTP Post error") expect(described_class).to receive(:post).and_raise("Some HTTP Post error")
   
expect { @web_hook.execute(@data) }. expect { @web_hook.execute(@data) }.
to raise_error(RuntimeError, 'Some HTTP Post error') to raise_error(RuntimeError, 'Some HTTP Post error')
Loading
Loading
Loading
@@ -22,15 +22,15 @@ describe API::API do
Loading
@@ -22,15 +22,15 @@ describe API::API do
   
post api("/builds/register"), token: runner.token, info: {platform: :darwin} post api("/builds/register"), token: runner.token, info: {platform: :darwin}
   
response.status.should eq 201 expect(response.status).to eq 201
json_response['sha'].should eq build.sha expect(json_response['sha']).to eq build.sha
runner.reload.platform.should eq "darwin" expect(runner.reload.platform).to eq "darwin"
end end
   
it "should return 404 error if no pending build found" do it "should return 404 error if no pending build found" do
post api("/builds/register"), token: runner.token post api("/builds/register"), token: runner.token
   
response.status.should eq 404 expect(response.status).to eq 404
end end
   
it "should return 404 error if no builds for specific runner" do it "should return 404 error if no builds for specific runner" do
Loading
@@ -39,7 +39,7 @@ describe API::API do
Loading
@@ -39,7 +39,7 @@ describe API::API do
   
post api("/builds/register"), token: runner.token post api("/builds/register"), token: runner.token
   
response.status.should eq 404 expect(response.status).to eq 404
end end
   
it "should return 404 error if no builds for shared runner" do it "should return 404 error if no builds for shared runner" do
Loading
@@ -48,7 +48,7 @@ describe API::API do
Loading
@@ -48,7 +48,7 @@ describe API::API do
   
post api("/builds/register"), token: shared_runner.token post api("/builds/register"), token: shared_runner.token
   
response.status.should eq 404 expect(response.status).to eq 404
end end
   
it "returns options" do it "returns options" do
Loading
@@ -57,8 +57,8 @@ describe API::API do
Loading
@@ -57,8 +57,8 @@ describe API::API do
   
post api("/builds/register"), token: runner.token, info: {platform: :darwin} post api("/builds/register"), token: runner.token, info: {platform: :darwin}
   
response.status.should eq 201 expect(response.status).to eq 201
json_response["options"].should eq({"image" => "ruby:2.1", "services" => ["postgres"]}) expect(json_response["options"]).to eq({"image" => "ruby:2.1", "services" => ["postgres"]})
end end
   
it "returns variables" do it "returns variables" do
Loading
@@ -68,8 +68,8 @@ describe API::API do
Loading
@@ -68,8 +68,8 @@ describe API::API do
   
post api("/builds/register"), token: runner.token, info: {platform: :darwin} post api("/builds/register"), token: runner.token, info: {platform: :darwin}
   
response.status.should eq 201 expect(response.status).to eq 201
json_response["variables"].should eq [ expect(json_response["variables"]).to eq [
{"key" => "DB_NAME", "value" => "postgres", "public" => true}, {"key" => "DB_NAME", "value" => "postgres", "public" => true},
{"key" => "SECRET_KEY", "value" => "secret_value", "public" => false}, {"key" => "SECRET_KEY", "value" => "secret_value", "public" => false},
] ]
Loading
@@ -85,8 +85,8 @@ describe API::API do
Loading
@@ -85,8 +85,8 @@ describe API::API do
   
post api("/builds/register"), token: runner.token, info: {platform: :darwin} post api("/builds/register"), token: runner.token, info: {platform: :darwin}
   
response.status.should eq 201 expect(response.status).to eq 201
json_response["variables"].should eq [ expect(json_response["variables"]).to eq [
{"key" => "DB_NAME", "value" => "postgres", "public" => true}, {"key" => "DB_NAME", "value" => "postgres", "public" => true},
{"key" => "SECRET_KEY", "value" => "secret_value", "public" => false}, {"key" => "SECRET_KEY", "value" => "secret_value", "public" => false},
{"key" => "TRIGGER_KEY", "value" => "TRIGGER_VALUE", "public" => false}, {"key" => "TRIGGER_KEY", "value" => "TRIGGER_VALUE", "public" => false},
Loading
@@ -101,7 +101,7 @@ describe API::API do
Loading
@@ -101,7 +101,7 @@ describe API::API do
it "should update a running build" do it "should update a running build" do
build.run! build.run!
put api("/builds/#{build.id}"), token: runner.token put api("/builds/#{build.id}"), token: runner.token
response.status.should eq 200 expect(response.status).to eq 200
end end
   
it 'Should not override trace information when no trace is given' do it 'Should not override trace information when no trace is given' do
Loading
Loading
Loading
@@ -19,10 +19,10 @@ describe API::API, 'Commits' do
Loading
@@ -19,10 +19,10 @@ describe API::API, 'Commits' do
it "should return commits per project" do it "should return commits per project" do
get api("/commits"), options get api("/commits"), options
   
response.status.should eq 200 expect(response.status).to eq 200
json_response.count.should eq 1 expect(json_response.count).to eq 1
json_response.first["project_id"].should eq project.id expect(json_response.first["project_id"]).to eq project.id
json_response.first["sha"].should eq commit.sha expect(json_response.first["sha"]).to eq commit.sha
end end
end end
   
Loading
@@ -51,15 +51,15 @@ describe API::API, 'Commits' do
Loading
@@ -51,15 +51,15 @@ describe API::API, 'Commits' do
it "should create a build" do it "should create a build" do
post api("/commits"), options.merge(data: data) post api("/commits"), options.merge(data: data)
   
response.status.should eq 201 expect(response.status).to eq 201
json_response['sha'].should eq "da1560886d4f094c3e6c9ef40349f7d38b5d27d7" expect(json_response['sha']).to eq "da1560886d4f094c3e6c9ef40349f7d38b5d27d7"
end end
   
it "should return 400 error if no data passed" do it "should return 400 error if no data passed" do
post api("/commits"), options post api("/commits"), options
   
response.status.should eq 400 expect(response.status).to eq 400
json_response['message'].should eq "400 (Bad request) \"data\" not given" expect(json_response['message']).to eq "400 (Bad request) \"data\" not given"
end end
end end
end end
Loading
@@ -41,8 +41,8 @@ describe API::API do
Loading
@@ -41,8 +41,8 @@ describe API::API do
   
it "should create a project with valid data" do it "should create a project with valid data" do
post api("/forks"), options post api("/forks"), options
response.status.should eq 201 expect(response.status).to eq 201
json_response['name'].should eq "Gitlab.org / Underscore" expect(json_response['name']).to eq "Gitlab.org / Underscore"
end end
end end
   
Loading
@@ -53,7 +53,7 @@ describe API::API do
Loading
@@ -53,7 +53,7 @@ describe API::API do
   
it "should error with invalid data" do it "should error with invalid data" do
post api("/forks"), options post api("/forks"), options
response.status.should eq 400 expect(response.status).to eq 400
end end
end end
end end
Loading
Loading
Loading
@@ -25,10 +25,10 @@ describe API::API do
Loading
@@ -25,10 +25,10 @@ describe API::API do
   
it "should return all projects on the CI instance" do it "should return all projects on the CI instance" do
get api("/projects"), options get api("/projects"), options
response.status.should eq 200 expect(response.status).to eq 200
json_response.count.should eq 2 expect(json_response.count).to eq 2
json_response.first["id"].should eq project1.id expect(json_response.first["id"]).to eq project1.id
json_response.last["id"].should eq project2.id expect(json_response.last["id"]).to eq project2.id
end end
end end
   
Loading
@@ -40,8 +40,8 @@ describe API::API do
Loading
@@ -40,8 +40,8 @@ describe API::API do
it "should return all projects on the CI instance" do it "should return all projects on the CI instance" do
get api("/projects/owned"), options get api("/projects/owned"), options
   
response.status.should eq 200 expect(response.status).to eq 200
json_response.count.should eq 0 expect(json_response.count).to eq 0
end end
end end
end end
Loading
@@ -58,19 +58,19 @@ describe API::API do
Loading
@@ -58,19 +58,19 @@ describe API::API do
   
it "should create webhook for specified project" do it "should create webhook for specified project" do
post api("/projects/#{project.id}/webhooks"), options post api("/projects/#{project.id}/webhooks"), options
response.status.should eq 201 expect(response.status).to eq 201
json_response["url"].should eq webhook[:web_hook] expect(json_response["url"]).to eq webhook[:web_hook]
end end
   
it "fails to create webhook for non existsing project" do it "fails to create webhook for non existsing project" do
post api("/projects/non-existant-id/webhooks"), options post api("/projects/non-existant-id/webhooks"), options
response.status.should eq 404 expect(response.status).to eq 404
end end
   
it "non-manager is not authorized" do it "non-manager is not authorized" do
allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false) allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false)
post api("/projects/#{project.id}/webhooks"), options post api("/projects/#{project.id}/webhooks"), options
response.status.should eq 401 expect(response.status).to eq 401
end end
end end
   
Loading
@@ -83,14 +83,14 @@ describe API::API do
Loading
@@ -83,14 +83,14 @@ describe API::API do
   
it "fails to create webhook for not valid url" do it "fails to create webhook for not valid url" do
post api("/projects/#{project.id}/webhooks"), options post api("/projects/#{project.id}/webhooks"), options
response.status.should eq 400 expect(response.status).to eq 400
end end
end end
   
context "Missed web_hook parameter" do context "Missed web_hook parameter" do
it "fails to create webhook for not provided url" do it "fails to create webhook for not provided url" do
post api("/projects/#{project.id}/webhooks"), options post api("/projects/#{project.id}/webhooks"), options
response.status.should eq 400 expect(response.status).to eq 400
end end
end end
end end
Loading
@@ -101,15 +101,15 @@ describe API::API do
Loading
@@ -101,15 +101,15 @@ describe API::API do
context "with an existing project" do context "with an existing project" do
it "should retrieve the project info" do it "should retrieve the project info" do
get api("/projects/#{project.id}"), options get api("/projects/#{project.id}"), options
response.status.should eq 200 expect(response.status).to eq 200
json_response['id'].should eq project.id expect(json_response['id']).to eq project.id
end end
end end
   
context "with a non-existing project" do context "with a non-existing project" do
it "should return 404 error if project not found" do it "should return 404 error if project not found" do
get api("/projects/non_existent_id"), options get api("/projects/non_existent_id"), options
response.status.should eq 404 expect(response.status).to eq 404
end end
end end
end end
Loading
@@ -124,19 +124,19 @@ describe API::API do
Loading
@@ -124,19 +124,19 @@ describe API::API do
   
it "should update a specific project's information" do it "should update a specific project's information" do
put api("/projects/#{project.id}"), options put api("/projects/#{project.id}"), options
response.status.should eq 200 expect(response.status).to eq 200
json_response["name"].should eq project_info[:name] expect(json_response["name"]).to eq project_info[:name]
end end
   
it "fails to update a non-existing project" do it "fails to update a non-existing project" do
put api("/projects/non-existant-id"), options put api("/projects/non-existant-id"), options
response.status.should eq 404 expect(response.status).to eq 404
end end
   
it "non-manager is not authorized" do it "non-manager is not authorized" do
allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false) allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false)
put api("/projects/#{project.id}"), options put api("/projects/#{project.id}"), options
response.status.should eq 401 expect(response.status).to eq 401
end end
end end
   
Loading
@@ -145,7 +145,7 @@ describe API::API do
Loading
@@ -145,7 +145,7 @@ describe API::API do
   
it "should delete a specific project" do it "should delete a specific project" do
delete api("/projects/#{project.id}"), options delete api("/projects/#{project.id}"), options
response.status.should eq 200 expect(response.status).to eq 200
   
expect { project.reload }.to raise_error(ActiveRecord::RecordNotFound) expect { project.reload }.to raise_error(ActiveRecord::RecordNotFound)
end end
Loading
@@ -153,12 +153,12 @@ describe API::API do
Loading
@@ -153,12 +153,12 @@ describe API::API do
it "non-manager is not authorized" do it "non-manager is not authorized" do
allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false) allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false)
delete api("/projects/#{project.id}"), options delete api("/projects/#{project.id}"), options
response.status.should eq 401 expect(response.status).to eq 401
end end
   
it "is getting not found error" do it "is getting not found error" do
delete api("/projects/not-existing_id"), options delete api("/projects/not-existing_id"), options
response.status.should eq 404 expect(response.status).to eq 404
end end
end end
   
Loading
@@ -181,8 +181,8 @@ describe API::API do
Loading
@@ -181,8 +181,8 @@ describe API::API do
   
it "should create a project with valid data" do it "should create a project with valid data" do
post api("/projects"), options post api("/projects"), options
response.status.should eq 201 expect(response.status).to eq 201
json_response['name'].should eq project_info[:name] expect(json_response['name']).to eq project_info[:name]
end end
end end
   
Loading
@@ -193,7 +193,7 @@ describe API::API do
Loading
@@ -193,7 +193,7 @@ describe API::API do
   
it "should error with invalid data" do it "should error with invalid data" do
post api("/projects"), options post api("/projects"), options
response.status.should eq 400 expect(response.status).to eq 400
end end
end end
   
Loading
@@ -203,24 +203,24 @@ describe API::API do
Loading
@@ -203,24 +203,24 @@ describe API::API do
   
it "should add the project to the runner" do it "should add the project to the runner" do
post api("/projects/#{project.id}/runners/#{runner.id}"), options post api("/projects/#{project.id}/runners/#{runner.id}"), options
response.status.should eq 201 expect(response.status).to eq 201
   
project.reload project.reload
project.runners.first.id.should eq runner.id expect(project.runners.first.id).to eq runner.id
end end
   
it "should fail if it tries to link a non-existing project or runner" do it "should fail if it tries to link a non-existing project or runner" do
post api("/projects/#{project.id}/runners/non-existing"), options post api("/projects/#{project.id}/runners/non-existing"), options
response.status.should eq 404 expect(response.status).to eq 404
   
post api("/projects/non-existing/runners/#{runner.id}"), options post api("/projects/non-existing/runners/#{runner.id}"), options
response.status.should eq 404 expect(response.status).to eq 404
end end
   
it "non-manager is not authorized" do it "non-manager is not authorized" do
allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false) allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false)
post api("/projects/#{project.id}/runners/#{runner.id}"), options post api("/projects/#{project.id}/runners/#{runner.id}"), options
response.status.should eq 401 expect(response.status).to eq 401
end end
end end
   
Loading
@@ -233,18 +233,18 @@ describe API::API do
Loading
@@ -233,18 +233,18 @@ describe API::API do
end end
   
it "should remove the project from the runner" do it "should remove the project from the runner" do
project.runners.should be_present expect(project.runners).to be_present
delete api("/projects/#{project.id}/runners/#{runner.id}"), options delete api("/projects/#{project.id}/runners/#{runner.id}"), options
response.status.should eq 200 expect(response.status).to eq 200
   
project.reload project.reload
project.runners.should be_empty expect(project.runners).to be_empty
end end
   
it "non-manager is not authorized" do it "non-manager is not authorized" do
allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false) allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false)
post api("/projects/#{project.id}/runners/#{runner.id}"), options post api("/projects/#{project.id}/runners/#{runner.id}"), options
response.status.should eq 401 expect(response.status).to eq 401
end end
end end
end end
Loading
Loading
Loading
@@ -24,10 +24,10 @@ describe API::API do
Loading
@@ -24,10 +24,10 @@ describe API::API do
   
it "should retrieve a list of all runners" do it "should retrieve a list of all runners" do
get api("/runners"), options get api("/runners"), options
response.status.should eq 200 expect(response.status).to eq 200
json_response.count.should eq 5 expect(json_response.count).to eq 5
json_response.last.should have_key("id") expect(json_response.last).to have_key("id")
json_response.last.should have_key("token") expect(json_response.last).to have_key("token")
end end
end end
   
Loading
@@ -35,41 +35,41 @@ describe API::API do
Loading
@@ -35,41 +35,41 @@ describe API::API do
describe "should create a runner if token provided" do describe "should create a runner if token provided" do
before { post api("/runners/register"), token: GitlabCi::REGISTRATION_TOKEN } before { post api("/runners/register"), token: GitlabCi::REGISTRATION_TOKEN }
   
it { response.status.should eq 201 } it { expect(response.status).to eq 201 }
end end
   
describe "should create a runner with description" do describe "should create a runner with description" do
before { post api("/runners/register"), token: GitlabCi::REGISTRATION_TOKEN, description: "server.hostname" } before { post api("/runners/register"), token: GitlabCi::REGISTRATION_TOKEN, description: "server.hostname" }
   
it { response.status.should eq 201 } it { expect(response.status).to eq 201 }
it { Runner.first.description.should eq "server.hostname" } it { expect(Runner.first.description).to eq "server.hostname" }
end end
   
describe "should create a runner with tags" do describe "should create a runner with tags" do
before { post api("/runners/register"), token: GitlabCi::REGISTRATION_TOKEN, tag_list: "tag1, tag2" } before { post api("/runners/register"), token: GitlabCi::REGISTRATION_TOKEN, tag_list: "tag1, tag2" }
   
it { response.status.should eq 201 } it { expect(response.status).to eq 201 }
it { Runner.first.tag_list.sort.should eq ["tag1", "tag2"] } it { expect(Runner.first.tag_list.sort).to eq ["tag1", "tag2"] }
end end
   
describe "should create a runner if project token provided" do describe "should create a runner if project token provided" do
let(:project) { FactoryGirl.create(:project) } let(:project) { FactoryGirl.create(:project) }
before { post api("/runners/register"), token: project.token } before { post api("/runners/register"), token: project.token }
   
it { response.status.should eq 201 } it { expect(response.status).to eq 201 }
it { project.runners.size.should eq 1 } it { expect(project.runners.size).to eq 1 }
end end
   
it "should return 403 error if token is invalid" do it "should return 403 error if token is invalid" do
post api("/runners/register"), token: 'invalid' post api("/runners/register"), token: 'invalid'
   
response.status.should eq 403 expect(response.status).to eq 403
end end
   
it "should return 400 error if no token" do it "should return 400 error if no token" do
post api("/runners/register") post api("/runners/register")
   
response.status.should eq 400 expect(response.status).to eq 400
end end
end end
   
Loading
@@ -77,7 +77,7 @@ describe API::API do
Loading
@@ -77,7 +77,7 @@ describe API::API do
let!(:runner) { FactoryGirl.create(:runner) } let!(:runner) { FactoryGirl.create(:runner) }
before { delete api("/runners/delete"), token: runner.token } before { delete api("/runners/delete"), token: runner.token }
   
it { response.status.should eq 200 } it { expect(response.status).to eq 200 }
it { Runner.count.should eq 0 } it { expect(Runner.count).to eq 0 }
end end
end end
Loading
@@ -17,17 +17,17 @@ describe API::API do
Loading
@@ -17,17 +17,17 @@ describe API::API do
context 'Handles errors' do context 'Handles errors' do
it 'should return bad request if token is missing' do it 'should return bad request if token is missing' do
post api("/projects/#{project.id}/refs/master/trigger") post api("/projects/#{project.id}/refs/master/trigger")
response.status.should eq 400 expect(response.status).to eq 400
end end
   
it 'should return not found if project is not found' do it 'should return not found if project is not found' do
post api('/projects/0/refs/master/trigger'), options post api('/projects/0/refs/master/trigger'), options
response.status.should eq 404 expect(response.status).to eq 404
end end
   
it 'should return unauthorized if token is for different project' do it 'should return unauthorized if token is for different project' do
post api("/projects/#{project2.id}/refs/master/trigger"), options post api("/projects/#{project2.id}/refs/master/trigger"), options
response.status.should eq 401 expect(response.status).to eq 401
end end
end end
   
Loading
@@ -38,15 +38,15 @@ describe API::API do
Loading
@@ -38,15 +38,15 @@ describe API::API do
   
it 'should create builds' do it 'should create builds' do
post api("/projects/#{project.id}/refs/master/trigger"), options post api("/projects/#{project.id}/refs/master/trigger"), options
response.status.should eq 201 expect(response.status).to eq 201
@commit.builds.reload @commit.builds.reload
@commit.builds.size.should eq 2 expect(@commit.builds.size).to eq 2
end end
   
it 'should return bad request with no builds created if there\'s no commit for that ref' do it 'should return bad request with no builds created if there\'s no commit for that ref' do
post api("/projects/#{project.id}/refs/other-branch/trigger"), options post api("/projects/#{project.id}/refs/other-branch/trigger"), options
response.status.should eq 400 expect(response.status).to eq 400
json_response['message'].should eq 'No builds created' expect(json_response['message']).to eq 'No builds created'
end end
   
context 'Validates variables' do context 'Validates variables' do
Loading
@@ -56,21 +56,21 @@ describe API::API do
Loading
@@ -56,21 +56,21 @@ describe API::API do
   
it 'should validate variables to be a hash' do it 'should validate variables to be a hash' do
post api("/projects/#{project.id}/refs/master/trigger"), options.merge(variables: 'value') post api("/projects/#{project.id}/refs/master/trigger"), options.merge(variables: 'value')
response.status.should eq 400 expect(response.status).to eq 400
json_response['message'].should eq 'variables needs to be a hash' expect(json_response['message']).to eq 'variables needs to be a hash'
end end
   
it 'should validate variables needs to be a map of key-valued strings' do it 'should validate variables needs to be a map of key-valued strings' do
post api("/projects/#{project.id}/refs/master/trigger"), options.merge(variables: {key: %w(1 2)}) post api("/projects/#{project.id}/refs/master/trigger"), options.merge(variables: {key: %w(1 2)})
response.status.should eq 400 expect(response.status).to eq 400
json_response['message'].should eq 'variables needs to be a map of key-valued strings' expect(json_response['message']).to eq 'variables needs to be a map of key-valued strings'
end end
   
it 'create trigger request with variables' do it 'create trigger request with variables' do
post api("/projects/#{project.id}/refs/master/trigger"), options.merge(variables: variables) post api("/projects/#{project.id}/refs/master/trigger"), options.merge(variables: variables)
response.status.should eq 201 expect(response.status).to eq 201
@commit.builds.reload @commit.builds.reload
@commit.builds.first.trigger_request.variables.should eq variables expect(@commit.builds.first.trigger_request.variables).to eq variables
end end
end end
end end
Loading
Loading
Loading
@@ -12,7 +12,7 @@ describe "Builds" do
Loading
@@ -12,7 +12,7 @@ describe "Builds" do
get status_project_build_path(@project, @build), format: :json get status_project_build_path(@project, @build), format: :json
end end
   
it { response.status.should eq 200 } it { expect(response.status).to eq 200 }
it { response.body.should include(@build.sha) } it { expect(response.body).to include(@build.sha) }
end end
end end
Loading
@@ -11,7 +11,7 @@ describe "Commits" do
Loading
@@ -11,7 +11,7 @@ describe "Commits" do
get status_project_ref_commit_path(@project, @commit.ref, @commit.sha), format: :json get status_project_ref_commit_path(@project, @commit.ref, @commit.sha), format: :json
end end
   
it { response.status.should eq 200 } it { expect(response.status).to eq 200 }
it { response.body.should include(@commit.sha) } it { expect(response.body).to include(@commit.sha) }
end end
end end
Loading
@@ -16,11 +16,11 @@ describe CreateCommitService do
Loading
@@ -16,11 +16,11 @@ describe CreateCommitService do
) )
end end
   
it { commit.should be_kind_of(Commit) } it { expect(commit).to be_kind_of(Commit) }
it { commit.should be_valid } it { expect(commit).to be_valid }
it { commit.should be_persisted } it { expect(commit).to be_persisted }
it { commit.should eq project.commits.last } it { expect(commit).to eq project.commits.last }
it { commit.builds.first.should be_kind_of(Build) } it { expect(commit.builds.first).to be_kind_of(Build) }
end end
   
context "skip tag if there is no build for it" do context "skip tag if there is no build for it" do
Loading
@@ -32,7 +32,7 @@ describe CreateCommitService do
Loading
@@ -32,7 +32,7 @@ describe CreateCommitService do
ci_yaml_file: gitlab_ci_yaml, ci_yaml_file: gitlab_ci_yaml,
commits: [ { message: "Message" } ] commits: [ { message: "Message" } ]
) )
result.should be_persisted expect(result).to be_persisted
end end
   
it "creates commit if there is no appropriate job but deploy job has right ref setting" do it "creates commit if there is no appropriate job but deploy job has right ref setting" do
Loading
@@ -45,7 +45,7 @@ describe CreateCommitService do
Loading
@@ -45,7 +45,7 @@ describe CreateCommitService do
ci_yaml_file: config, ci_yaml_file: config,
commits: [ { message: "Message" } ] commits: [ { message: "Message" } ]
) )
result.should be_persisted expect(result).to be_persisted
end end
end end
   
Loading
@@ -59,8 +59,8 @@ describe CreateCommitService do
Loading
@@ -59,8 +59,8 @@ describe CreateCommitService do
commits: commits, commits: commits,
ci_yaml_file: gitlab_ci_yaml ci_yaml_file: gitlab_ci_yaml
) )
commit.builds.any?.should be_falsey expect(commit.builds.any?).to be_falsey
commit.status.should eq "skipped" expect(commit.status).to eq "skipped"
end end
   
it "does not skips builds creation if there is no [ci skip] tag in commit message" do it "does not skips builds creation if there is no [ci skip] tag in commit message" do
Loading
@@ -74,7 +74,7 @@ describe CreateCommitService do
Loading
@@ -74,7 +74,7 @@ describe CreateCommitService do
ci_yaml_file: gitlab_ci_yaml ci_yaml_file: gitlab_ci_yaml
) )
commit.builds.first.name.should eq "staging" expect(commit.builds.first.name).to eq "staging"
end end
   
it "skips builds creation if there is [ci skip] tag in commit message and yaml is invalid" do it "skips builds creation if there is [ci skip] tag in commit message and yaml is invalid" do
Loading
@@ -86,8 +86,8 @@ describe CreateCommitService do
Loading
@@ -86,8 +86,8 @@ describe CreateCommitService do
commits: commits, commits: commits,
ci_yaml_file: "invalid: file" ci_yaml_file: "invalid: file"
) )
commit.builds.any?.should be_falsey expect(commit.builds.any?).to be_falsey
commit.status.should eq "skipped" expect(commit.status).to eq "skipped"
end end
end end
   
Loading
@@ -100,7 +100,7 @@ describe CreateCommitService do
Loading
@@ -100,7 +100,7 @@ describe CreateCommitService do
commits: commits, commits: commits,
ci_yaml_file: gitlab_ci_yaml ci_yaml_file: gitlab_ci_yaml
) )
commit.builds.count(:all).should eq 2 expect(commit.builds.count(:all)).to eq 2
   
commit = service.execute(project, commit = service.execute(project,
ref: 'refs/heads/master', ref: 'refs/heads/master',
Loading
@@ -109,7 +109,7 @@ describe CreateCommitService do
Loading
@@ -109,7 +109,7 @@ describe CreateCommitService do
commits: commits, commits: commits,
ci_yaml_file: gitlab_ci_yaml ci_yaml_file: gitlab_ci_yaml
) )
commit.builds.count(:all).should eq 2 expect(commit.builds.count(:all)).to eq 2
end end
   
it "creates commit with failed status if yaml is invalid" do it "creates commit with failed status if yaml is invalid" do
Loading
@@ -123,8 +123,8 @@ describe CreateCommitService do
Loading
@@ -123,8 +123,8 @@ describe CreateCommitService do
ci_yaml_file: "invalid: file" ci_yaml_file: "invalid: file"
) )
   
commit.status.should eq "failed" expect(commit.status).to eq "failed"
commit.builds.any?.should be_falsey expect(commit.builds.any?).to be_falsey
end end
end end
end end
Loading
@@ -11,8 +11,8 @@ describe CreateProjectService do
Loading
@@ -11,8 +11,8 @@ describe CreateProjectService do
context 'valid params' do context 'valid params' do
let(:project) { service.execute(current_user, project_dump, 'http://localhost/projects/:project_id') } let(:project) { service.execute(current_user, project_dump, 'http://localhost/projects/:project_id') }
   
it { project.should be_kind_of(Project) } it { expect(project).to be_kind_of(Project) }
it { project.should be_persisted } it { expect(project).to be_persisted }
end end
   
context 'without project dump' do context 'without project dump' do
Loading
@@ -32,9 +32,9 @@ describe CreateProjectService do
Loading
@@ -32,9 +32,9 @@ describe CreateProjectService do
   
project = service.execute(current_user, project_dump, 'http://localhost/projects/:project_id', origin_project) project = service.execute(current_user, project_dump, 'http://localhost/projects/:project_id', origin_project)
   
project.shared_runners_enabled.should be_truthy expect(project.shared_runners_enabled).to be_truthy
project.public.should be_truthy expect(project.public).to be_truthy
project.allow_git_fetch.should be_truthy expect(project.allow_git_fetch).to be_truthy
end end
end end
end end
Loading
Loading
Loading
@@ -13,14 +13,14 @@ describe CreateTriggerRequestService do
Loading
@@ -13,14 +13,14 @@ describe CreateTriggerRequestService do
@commit = FactoryGirl.create :commit, project: project @commit = FactoryGirl.create :commit, project: project
end end
   
it { subject.should be_kind_of(TriggerRequest) } it { expect(subject).to be_kind_of(TriggerRequest) }
it { subject.commit.should eq @commit } it { expect(subject.commit).to eq @commit }
end end
   
context 'no commit for ref' do context 'no commit for ref' do
subject { service.execute(project, trigger, 'other-branch') } subject { service.execute(project, trigger, 'other-branch') }
   
it { subject.should be_nil } it { expect(subject).to be_nil }
end end
   
context 'no builds created' do context 'no builds created' do
Loading
@@ -30,7 +30,7 @@ describe CreateTriggerRequestService do
Loading
@@ -30,7 +30,7 @@ describe CreateTriggerRequestService do
FactoryGirl.create :commit_without_jobs, project: project FactoryGirl.create :commit_without_jobs, project: project
end end
   
it { subject.should be_nil } it { expect(subject).to be_nil }
end end
   
context 'for multiple commits' do context 'for multiple commits' do
Loading
@@ -43,9 +43,9 @@ describe CreateTriggerRequestService do
Loading
@@ -43,9 +43,9 @@ describe CreateTriggerRequestService do
end end
   
context 'retries latest one' do context 'retries latest one' do
it { subject.should be_kind_of(TriggerRequest) } it { expect(subject).to be_kind_of(TriggerRequest) }
it { subject.should be_persisted } it { expect(subject).to be_persisted }
it { subject.commit.should eq @commit2 } it { expect(subject.commit).to eq @commit2 }
end end
end end
end end
Loading
Loading
Loading
@@ -12,7 +12,7 @@ describe EventService do
Loading
@@ -12,7 +12,7 @@ describe EventService do
it "creates event" do it "creates event" do
described_class.new.remove_project(user, project) described_class.new.remove_project(user, project)
   
Event.admin.last.description.should eq "Project \"GitLab / gitlab-shell\" has been removed by root" expect(Event.admin.last.description).to eq "Project \"GitLab / gitlab-shell\" has been removed by root"
end end
end end
   
Loading
@@ -20,7 +20,7 @@ describe EventService do
Loading
@@ -20,7 +20,7 @@ describe EventService do
it "creates event" do it "creates event" do
described_class.new.create_project(user, project) described_class.new.create_project(user, project)
   
Event.admin.last.description.should eq "Project \"GitLab / gitlab-shell\" has been created by root" expect(Event.admin.last.description).to eq "Project \"GitLab / gitlab-shell\" has been created by root"
end end
end end
   
Loading
@@ -28,7 +28,7 @@ describe EventService do
Loading
@@ -28,7 +28,7 @@ describe EventService do
it "creates event" do it "creates event" do
described_class.new.change_project_settings(user, project) described_class.new.change_project_settings(user, project)
   
Event.last.description.should eq "User \"root\" updated projects settings" expect(Event.last.description).to eq "User \"root\" updated projects settings"
end end
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment