summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-08-30 18:46:21 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-08-30 18:46:21 -0400
commit7d7f0a2954a524049d9faa167d13e2aebf16fc5f (patch)
tree08b6770ad09854a75e5c385ac29354c7f363d337
parente42388f83cef283aef31d59cc72ea288ddb509fd (diff)
downloadgitlab-ci-7d7f0a2954a524049d9faa167d13e2aebf16fc5f.tar.gz
Use `eq` instead of `==` in matchers
-rw-r--r--spec/features/triggers_spec.rb4
-rw-r--r--spec/features/variables_spec.rb2
-rw-r--r--spec/helpers/application_helper_spec.rb6
-rw-r--r--spec/helpers/user_helper_spec.rb12
-rw-r--r--spec/lib/ansi2html_spec.rb66
-rw-r--r--spec/lib/charts_spec.rb2
-rw-r--r--spec/lib/gitlab_ci_yaml_processor_spec.rb36
-rw-r--r--spec/lib/upgrader_spec.rb2
-rw-r--r--spec/models/commit_spec.rb40
-rw-r--r--spec/models/mail_service_spec.rb2
-rw-r--r--spec/models/project_services/slack_message_spec.rb12
-rw-r--r--spec/models/project_spec.rb24
-rw-r--r--spec/models/runner_spec.rb2
-rw-r--r--spec/models/service_spec.rb2
-rw-r--r--spec/models/trigger_spec.rb2
-rw-r--r--spec/models/user_spec.rb4
-rw-r--r--spec/requests/api/builds_spec.rb26
-rw-r--r--spec/requests/api/commits_spec.rb16
-rw-r--r--spec/requests/api/forks_spec.rb6
-rw-r--r--spec/requests/api/projects_spec.rb64
-rw-r--r--spec/requests/api/runners_spec.rb26
-rw-r--r--spec/requests/api/triggers_spec.rb26
-rw-r--r--spec/requests/builds_spec.rb2
-rw-r--r--spec/requests/commits_spec.rb2
-rw-r--r--spec/services/create_commit_service_spec.rb14
-rw-r--r--spec/services/create_trigger_request_service_spec.rb4
-rw-r--r--spec/services/event_service_spec.rb6
-rw-r--r--spec/services/image_for_build_service_spec.rb8
-rw-r--r--spec/services/register_build_service_spec.rb12
29 files changed, 215 insertions, 215 deletions
diff --git a/spec/features/triggers_spec.rb b/spec/features/triggers_spec.rb
index 1c7a479..9a1bc77 100644
--- a/spec/features/triggers_spec.rb
+++ b/spec/features/triggers_spec.rb
@@ -11,7 +11,7 @@ describe 'Variables', feature: true do
context 'create a trigger' do
before do
click_on 'Add Trigger'
- @project.triggers.count.should == 1
+ @project.triggers.count.should eq 1
end
it 'contains trigger token' do
@@ -20,7 +20,7 @@ describe 'Variables', feature: true do
it 'revokes the trigger' do
click_on 'Revoke'
- @project.triggers.count.should == 0
+ @project.triggers.count.should eq 0
end
end
end
diff --git a/spec/features/variables_spec.rb b/spec/features/variables_spec.rb
index 9f35132..f0b0cd8 100644
--- a/spec/features/variables_spec.rb
+++ b/spec/features/variables_spec.rb
@@ -19,7 +19,7 @@ describe "Variables", feature: true do
click_on "Save changes"
expect(page).to have_content("Variables were successfully updated.")
- @project.variables.count.should == 1
+ @project.variables.count.should eq 1
end
end
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index c2b1058..4e2ba8d 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -11,12 +11,12 @@ describe ApplicationHelper do
}
intervals_in_words.each do |interval, expectation|
- duration_in_words(Time.now + interval, Time.now).should == expectation
+ duration_in_words(Time.now + interval, Time.now).should eq expectation
end
end
it "calculates interval from now if there is no finished_at" do
- duration_in_words(nil, Time.now - 5).should == "5 seconds"
+ duration_in_words(nil, Time.now - 5).should eq "5 seconds"
end
end
@@ -30,7 +30,7 @@ describe ApplicationHelper do
}
intervals_in_words.each do |interval, expectation|
- time_interval_in_words(interval).should == expectation
+ time_interval_in_words(interval).should eq expectation
end
end
end
diff --git a/spec/helpers/user_helper_spec.rb b/spec/helpers/user_helper_spec.rb
index 73bed7a..19fcb11 100644
--- a/spec/helpers/user_helper_spec.rb
+++ b/spec/helpers/user_helper_spec.rb
@@ -8,7 +8,7 @@ describe UserHelper do
let (:avatar_url) { nil }
it 'should return a generic avatar' do
- user_avatar_url(user).should == 'no_avatar.png'
+ user_avatar_url(user).should eq 'no_avatar.png'
end
end
@@ -17,11 +17,11 @@ describe UserHelper do
let (:avatar_url) { "#{base_url}?s=40&d=mm" }
it 'should return gravatar with default size' do
- user_avatar_url(user).should == "#{base_url}?s=40&d=identicon"
+ user_avatar_url(user).should eq "#{base_url}?s=40&d=identicon"
end
it 'should return gravatar with custom size' do
- user_avatar_url(user, 120).should == "#{base_url}?s=120&d=identicon"
+ user_avatar_url(user, 120).should eq "#{base_url}?s=120&d=identicon"
end
end
@@ -30,11 +30,11 @@ describe UserHelper do
let (:avatar_url) { "#{base_url}?s=40&d=mm" }
it 'should return gravatar with default size' do
- user_avatar_url(user).should == "#{base_url}?s=40&d=identicon"
+ user_avatar_url(user).should eq "#{base_url}?s=40&d=identicon"
end
it 'should return gravatar with custom size' do
- user_avatar_url(user, 120).should == "#{base_url}?s=120&d=identicon"
+ user_avatar_url(user, 120).should eq "#{base_url}?s=120&d=identicon"
end
end
@@ -42,7 +42,7 @@ describe UserHelper do
let (:avatar_url) { 'http://example.local/avatar.png' }
it 'should return custom avatar' do
- user_avatar_url(user).should == avatar_url
+ user_avatar_url(user).should eq avatar_url
end
end
end
diff --git a/spec/lib/ansi2html_spec.rb b/spec/lib/ansi2html_spec.rb
index aa60011..e8dc107 100644
--- a/spec/lib/ansi2html_spec.rb
+++ b/spec/lib/ansi2html_spec.rb
@@ -3,131 +3,131 @@ require 'spec_helper'
describe Ansi2html do
it "prints non-ansi as-is" do
- Ansi2html::convert("Hello").should == 'Hello'
+ Ansi2html::convert("Hello").should eq 'Hello'
end
it "strips non-color-changing controll sequences" do
- Ansi2html::convert("Hello \e[2Kworld").should == 'Hello world'
+ Ansi2html::convert("Hello \e[2Kworld").should eq 'Hello world'
end
it "prints simply red" do
- Ansi2html::convert("\e[31mHello\e[0m").should == '<span class="term-fg-red">Hello</span>'
+ Ansi2html::convert("\e[31mHello\e[0m").should eq '<span class="term-fg-red">Hello</span>'
end
it "prints simply red without trailing reset" do
- Ansi2html::convert("\e[31mHello").should == '<span class="term-fg-red">Hello</span>'
+ Ansi2html::convert("\e[31mHello").should eq '<span class="term-fg-red">Hello</span>'
end
it "prints simply yellow" do
- Ansi2html::convert("\e[33mHello\e[0m").should == '<span class="term-fg-yellow">Hello</span>'
+ Ansi2html::convert("\e[33mHello\e[0m").should eq '<span class="term-fg-yellow">Hello</span>'
end
it "prints default on blue" do
- Ansi2html::convert("\e[39;44mHello").should == '<span class="term-bg-blue">Hello</span>'
+ Ansi2html::convert("\e[39;44mHello").should eq '<span class="term-bg-blue">Hello</span>'
end
it "prints red on blue" do
- Ansi2html::convert("\e[31;44mHello").should == '<span class="term-fg-red term-bg-blue">Hello</span>'
+ Ansi2html::convert("\e[31;44mHello").should eq '<span class="term-fg-red term-bg-blue">Hello</span>'
end
it "resets colors after red on blue" do
- Ansi2html::convert("\e[31;44mHello\e[0m world").should == '<span class="term-fg-red term-bg-blue">Hello</span> world'
+ Ansi2html::convert("\e[31;44mHello\e[0m world").should eq '<span class="term-fg-red term-bg-blue">Hello</span> world'
end
it "performs color change from red/blue to yellow/blue" do
- Ansi2html::convert("\e[31;44mHello \e[33mworld").should == '<span class="term-fg-red term-bg-blue">Hello </span><span class="term-fg-yellow term-bg-blue">world</span>'
+ Ansi2html::convert("\e[31;44mHello \e[33mworld").should eq '<span class="term-fg-red term-bg-blue">Hello </span><span class="term-fg-yellow term-bg-blue">world</span>'
end
it "performs color change from red/blue to yellow/green" do
- Ansi2html::convert("\e[31;44mHello \e[33;42mworld").should == '<span class="term-fg-red term-bg-blue">Hello </span><span class="term-fg-yellow term-bg-green">world</span>'
+ Ansi2html::convert("\e[31;44mHello \e[33;42mworld").should eq '<span class="term-fg-red term-bg-blue">Hello </span><span class="term-fg-yellow term-bg-green">world</span>'
end
it "performs color change from red/blue to reset to yellow/green" do
- Ansi2html::convert("\e[31;44mHello\e[0m \e[33;42mworld").should == '<span class="term-fg-red term-bg-blue">Hello</span> <span class="term-fg-yellow term-bg-green">world</span>'
+ Ansi2html::convert("\e[31;44mHello\e[0m \e[33;42mworld").should eq '<span class="term-fg-red term-bg-blue">Hello</span> <span class="term-fg-yellow term-bg-green">world</span>'
end
it "ignores unsupported codes" do
- Ansi2html::convert("\e[51mHello\e[0m").should == 'Hello'
+ Ansi2html::convert("\e[51mHello\e[0m").should eq 'Hello'
end
it "prints light red" do
- Ansi2html::convert("\e[91mHello\e[0m").should == '<span class="term-fg-l-red">Hello</span>'
+ Ansi2html::convert("\e[91mHello\e[0m").should eq '<span class="term-fg-l-red">Hello</span>'
end
it "prints default on light red" do
- Ansi2html::convert("\e[101mHello\e[0m").should == '<span class="term-bg-l-red">Hello</span>'
+ Ansi2html::convert("\e[101mHello\e[0m").should eq '<span class="term-bg-l-red">Hello</span>'
end
it "performs color change from red/blue to default/blue" do
- Ansi2html::convert("\e[31;44mHello \e[39mworld").should == '<span class="term-fg-red term-bg-blue">Hello </span><span class="term-bg-blue">world</span>'
+ Ansi2html::convert("\e[31;44mHello \e[39mworld").should eq '<span class="term-fg-red term-bg-blue">Hello </span><span class="term-bg-blue">world</span>'
end
it "performs color change from light red/blue to default/blue" do
- Ansi2html::convert("\e[91;44mHello \e[39mworld").should == '<span class="term-fg-l-red term-bg-blue">Hello </span><span class="term-bg-blue">world</span>'
+ Ansi2html::convert("\e[91;44mHello \e[39mworld").should eq '<span class="term-fg-l-red term-bg-blue">Hello </span><span class="term-bg-blue">world</span>'
end
it "prints bold text" do
- Ansi2html::convert("\e[1mHello").should == '<span class="term-bold">Hello</span>'
+ Ansi2html::convert("\e[1mHello").should eq '<span class="term-bold">Hello</span>'
end
it "resets bold text" do
- Ansi2html::convert("\e[1mHello\e[21m world").should == '<span class="term-bold">Hello</span> world'
- Ansi2html::convert("\e[1mHello\e[22m world").should == '<span class="term-bold">Hello</span> world'
+ Ansi2html::convert("\e[1mHello\e[21m world").should eq '<span class="term-bold">Hello</span> world'
+ Ansi2html::convert("\e[1mHello\e[22m world").should eq '<span class="term-bold">Hello</span> world'
end
it "prints italic text" do
- Ansi2html::convert("\e[3mHello").should == '<span class="term-italic">Hello</span>'
+ Ansi2html::convert("\e[3mHello").should eq '<span class="term-italic">Hello</span>'
end
it "resets italic text" do
- Ansi2html::convert("\e[3mHello\e[23m world").should == '<span class="term-italic">Hello</span> world'
+ Ansi2html::convert("\e[3mHello\e[23m world").should eq '<span class="term-italic">Hello</span> world'
end
it "prints underlined text" do
- Ansi2html::convert("\e[4mHello").should == '<span class="term-underline">Hello</span>'
+ Ansi2html::convert("\e[4mHello").should eq '<span class="term-underline">Hello</span>'
end
it "resets underlined text" do
- Ansi2html::convert("\e[4mHello\e[24m world").should == '<span class="term-underline">Hello</span> world'
+ Ansi2html::convert("\e[4mHello\e[24m world").should eq '<span class="term-underline">Hello</span> world'
end
it "prints concealed text" do
- Ansi2html::convert("\e[8mHello").should == '<span class="term-conceal">Hello</span>'
+ Ansi2html::convert("\e[8mHello").should eq '<span class="term-conceal">Hello</span>'
end
it "resets concealed text" do
- Ansi2html::convert("\e[8mHello\e[28m world").should == '<span class="term-conceal">Hello</span> world'
+ Ansi2html::convert("\e[8mHello\e[28m world").should eq '<span class="term-conceal">Hello</span> world'
end
it "prints crossed-out text" do
- Ansi2html::convert("\e[9mHello").should == '<span class="term-cross">Hello</span>'
+ Ansi2html::convert("\e[9mHello").should eq '<span class="term-cross">Hello</span>'
end
it "resets crossed-out text" do
- Ansi2html::convert("\e[9mHello\e[29m world").should == '<span class="term-cross">Hello</span> world'
+ Ansi2html::convert("\e[9mHello\e[29m world").should eq '<span class="term-cross">Hello</span> world'
end
it "can print 256 xterm fg colors" do
- Ansi2html::convert("\e[38;5;16mHello").should == '<span class="xterm-fg-16">Hello</span>'
+ Ansi2html::convert("\e[38;5;16mHello").should eq '<span class="xterm-fg-16">Hello</span>'
end
it "can print 256 xterm fg colors on normal magenta background" do
- Ansi2html::convert("\e[38;5;16;45mHello").should == '<span class="xterm-fg-16 term-bg-magenta">Hello</span>'
+ Ansi2html::convert("\e[38;5;16;45mHello").should eq '<span class="xterm-fg-16 term-bg-magenta">Hello</span>'
end
it "can print 256 xterm bg colors" do
- Ansi2html::convert("\e[48;5;240mHello").should == '<span class="xterm-bg-240">Hello</span>'
+ Ansi2html::convert("\e[48;5;240mHello").should eq '<span class="xterm-bg-240">Hello</span>'
end
it "can print 256 xterm bg colors on normal magenta foreground" do
- Ansi2html::convert("\e[48;5;16;35mHello").should == '<span class="term-fg-magenta xterm-bg-16">Hello</span>'
+ Ansi2html::convert("\e[48;5;16;35mHello").should eq '<span class="term-fg-magenta xterm-bg-16">Hello</span>'
end
it "prints bold colored text vividly" do
- Ansi2html::convert("\e[1;31mHello\e[0m").should == '<span class="term-fg-l-red term-bold">Hello</span>'
+ Ansi2html::convert("\e[1;31mHello\e[0m").should eq '<span class="term-fg-l-red term-bold">Hello</span>'
end
it "prints bold light colored text correctly" do
- Ansi2html::convert("\e[1;91mHello\e[0m").should == '<span class="term-fg-l-red term-bold">Hello</span>'
+ Ansi2html::convert("\e[1;91mHello\e[0m").should eq '<span class="term-fg-l-red term-bold">Hello</span>'
end
end
diff --git a/spec/lib/charts_spec.rb b/spec/lib/charts_spec.rb
index 236cfc2..d3c78b6 100644
--- a/spec/lib/charts_spec.rb
+++ b/spec/lib/charts_spec.rb
@@ -11,7 +11,7 @@ describe "Charts" do
it 'should return build times in minutes' do
chart = Charts::BuildTime.new(@project)
- chart.build_times.should == [2]
+ chart.build_times.should eq [2]
end
end
end
diff --git a/spec/lib/gitlab_ci_yaml_processor_spec.rb b/spec/lib/gitlab_ci_yaml_processor_spec.rb
index ed3d4e8..054e039 100644
--- a/spec/lib/gitlab_ci_yaml_processor_spec.rb
+++ b/spec/lib/gitlab_ci_yaml_processor_spec.rb
@@ -13,8 +13,8 @@ describe GitlabCiYamlProcessor do
config_processor = GitlabCiYamlProcessor.new(config)
- config_processor.builds_for_stage_and_ref(type, "master").size.should == 1
- config_processor.builds_for_stage_and_ref(type, "master").first.should == {
+ config_processor.builds_for_stage_and_ref(type, "master").size.should eq 1
+ config_processor.builds_for_stage_and_ref(type, "master").first.should eq({
stage: "test",
except: nil,
name: :rspec,
@@ -23,7 +23,7 @@ describe GitlabCiYamlProcessor do
tags: [],
options: {},
allow_failure: false
- }
+ })
end
it "does not return builds if only has another branch" do
@@ -34,7 +34,7 @@ describe GitlabCiYamlProcessor do
config_processor = GitlabCiYamlProcessor.new(config)
- config_processor.builds_for_stage_and_ref(type, "master").size.should == 0
+ config_processor.builds_for_stage_and_ref(type, "master").size.should eq 0
end
it "does not return builds if only has regexp with another branch" do
@@ -45,7 +45,7 @@ describe GitlabCiYamlProcessor do
config_processor = GitlabCiYamlProcessor.new(config)
- config_processor.builds_for_stage_and_ref(type, "master").size.should == 0
+ config_processor.builds_for_stage_and_ref(type, "master").size.should eq 0
end
it "returns builds if only has specified this branch" do
@@ -56,7 +56,7 @@ describe GitlabCiYamlProcessor do
config_processor = GitlabCiYamlProcessor.new(config)
- config_processor.builds_for_stage_and_ref(type, "master").size.should == 1
+ config_processor.builds_for_stage_and_ref(type, "master").size.should eq 1
end
it "does not build tags" do
@@ -67,7 +67,7 @@ describe GitlabCiYamlProcessor do
config_processor = GitlabCiYamlProcessor.new(config)
- config_processor.builds_for_stage_and_ref(type, "0-1", true).size.should == 0
+ config_processor.builds_for_stage_and_ref(type, "0-1", true).size.should eq 0
end
it "returns builds if only has a list of branches including specified" do
@@ -78,7 +78,7 @@ describe GitlabCiYamlProcessor do
config_processor = GitlabCiYamlProcessor.new(config)
- config_processor.builds_for_stage_and_ref(type, "deploy").size.should == 1
+ config_processor.builds_for_stage_and_ref(type, "deploy").size.should eq 1
end
it "returns build only for specified type" do
@@ -93,9 +93,9 @@ describe GitlabCiYamlProcessor do
config_processor = GitlabCiYamlProcessor.new(config)
- config_processor.builds_for_stage_and_ref("production", "deploy").size.should == 0
- config_processor.builds_for_stage_and_ref(type, "deploy").size.should == 1
- config_processor.builds_for_stage_and_ref("deploy", "deploy").size.should == 2
+ config_processor.builds_for_stage_and_ref("production", "deploy").size.should eq 0
+ config_processor.builds_for_stage_and_ref(type, "deploy").size.should eq 1
+ config_processor.builds_for_stage_and_ref("deploy", "deploy").size.should eq 2
end
end
@@ -110,8 +110,8 @@ describe GitlabCiYamlProcessor do
config_processor = GitlabCiYamlProcessor.new(config)
- config_processor.builds_for_stage_and_ref("test", "master").size.should == 1
- config_processor.builds_for_stage_and_ref("test", "master").first.should == {
+ config_processor.builds_for_stage_and_ref("test", "master").size.should eq 1
+ config_processor.builds_for_stage_and_ref("test", "master").first.should eq({
except: nil,
stage: "test",
name: :rspec,
@@ -123,7 +123,7 @@ describe GitlabCiYamlProcessor do
services: ["mysql"]
},
allow_failure: false
- }
+ })
end
it "returns image and service when overridden for job" do
@@ -136,8 +136,8 @@ describe GitlabCiYamlProcessor do
config_processor = GitlabCiYamlProcessor.new(config)
- config_processor.builds_for_stage_and_ref("test", "master").size.should == 1
- config_processor.builds_for_stage_and_ref("test", "master").first.should == {
+ config_processor.builds_for_stage_and_ref("test", "master").size.should eq 1
+ config_processor.builds_for_stage_and_ref("test", "master").first.should eq({
except: nil,
stage: "test",
name: :rspec,
@@ -149,7 +149,7 @@ describe GitlabCiYamlProcessor do
services: ["postgresql"]
},
allow_failure: false
- }
+ })
end
end
@@ -166,7 +166,7 @@ describe GitlabCiYamlProcessor do
})
config_processor = GitlabCiYamlProcessor.new(config)
- config_processor.variables.should == variables
+ config_processor.variables.should eq variables
end
end
diff --git a/spec/lib/upgrader_spec.rb b/spec/lib/upgrader_spec.rb
index b1c3651..9d86af0 100644
--- a/spec/lib/upgrader_spec.rb
+++ b/spec/lib/upgrader_spec.rb
@@ -5,7 +5,7 @@ describe Upgrader do
let(:current_version) { GitlabCi::VERSION }
describe 'current_version_raw' do
- it { upgrader.current_version_raw.should == current_version }
+ it { upgrader.current_version_raw.should eq current_version }
end
describe 'latest_version?' do
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index 6e1d91d..fb3f218 100644
--- a/spec/models/commit_spec.rb
+++ b/spec/models/commit_spec.rb
@@ -68,7 +68,7 @@ describe Commit do
commit = FactoryGirl.create :commit, project: project
expected = 'commit_pusher_email'
commit.stub(:push_data) { { user_email: expected } }
- commit.project_recipients.should == [expected]
+ commit.project_recipients.should eq [expected]
end
it 'should return commit_pusher_email and additional recipients' do
@@ -78,7 +78,7 @@ describe Commit do
commit = FactoryGirl.create :commit, project: project
expected = 'commit_pusher_email'
commit.stub(:push_data) { { user_email: expected } }
- commit.project_recipients.should == ['rec1', 'rec2', expected]
+ commit.project_recipients.should eq ['rec1', 'rec2', expected]
end
it 'should return recipients' do
@@ -86,7 +86,7 @@ describe Commit do
email_add_pusher: false,
email_recipients: 'rec1 rec2'
commit = FactoryGirl.create :commit, project: project
- commit.project_recipients.should == ['rec1', 'rec2']
+ commit.project_recipients.should eq ['rec1', 'rec2']
end
it 'should return unique recipients only' do
@@ -96,7 +96,7 @@ describe Commit do
commit = FactoryGirl.create :commit, project: project
expected = 'rec2'
commit.stub(:push_data) { { user_email: expected } }
- commit.project_recipients.should == ['rec1', 'rec2']
+ commit.project_recipients.should eq ['rec1', 'rec2']
end
end
end
@@ -142,15 +142,15 @@ describe Commit do
it "creates builds for next type" do
commit.create_builds.should be_truthy
commit.builds.reload
- commit.builds.size.should == 2
+ commit.builds.size.should eq 2
commit.create_next_builds(nil).should be_truthy
commit.builds.reload
- commit.builds.size.should == 4
+ commit.builds.size.should eq 4
commit.create_next_builds(nil).should be_truthy
commit.builds.reload
- commit.builds.size.should == 5
+ commit.builds.size.should eq 5
commit.create_next_builds(nil).should be_falsey
end
@@ -164,7 +164,7 @@ describe Commit do
it 'creates builds' do
commit.create_builds.should be_truthy
commit.builds.reload
- commit.builds.size.should == 2
+ commit.builds.size.should eq 2
end
context 'for build triggers' do
@@ -174,27 +174,27 @@ describe Commit do
it 'creates builds' do
commit.create_builds(trigger_request).should be_truthy
commit.builds.reload
- commit.builds.size.should == 2
+ commit.builds.size.should eq 2
end
it 'rebuilds commit' do
commit.create_builds.should be_truthy
commit.builds.reload
- commit.builds.size.should == 2
+ commit.builds.size.should eq 2
commit.create_builds(trigger_request).should be_truthy
commit.builds.reload
- commit.builds.size.should == 4
+ commit.builds.size.should eq 4
end
it 'creates next builds' do
commit.create_builds(trigger_request).should be_truthy
commit.builds.reload
- commit.builds.size.should == 2
+ commit.builds.size.should eq 2
commit.create_next_builds(trigger_request).should be_truthy
commit.builds.reload
- commit.builds.size.should == 4
+ commit.builds.size.should eq 4
end
context 'for [ci skip]' do
@@ -204,11 +204,11 @@ describe Commit do
end
it 'rebuilds commit' do
- commit.status.should == 'skipped'
+ commit.status.should eq 'skipped'
commit.create_builds(trigger_request).should be_truthy
commit.builds.reload
- commit.builds.size.should == 2
- commit.status.should == 'pending'
+ commit.builds.size.should eq 2
+ commit.status.should eq 'pending'
end
end
end
@@ -222,7 +222,7 @@ describe Commit do
build = FactoryGirl.create :build, commit: commit, finished_at: Time.now - 60
build1 = FactoryGirl.create :build, commit: commit, finished_at: Time.now - 120
- commit.finished_at.to_i.should == build.finished_at.to_i
+ commit.finished_at.to_i.should eq build.finished_at.to_i
end
it "returns nil if there is no finished build" do
@@ -239,21 +239,21 @@ describe Commit do
it "calculates average when there are two builds with coverage" do
FactoryGirl.create :build, name: "rspec", coverage: 30, commit: commit
FactoryGirl.create :build, name: "rubocop", coverage: 40, commit: commit
- commit.coverage.should == "35.00"
+ commit.coverage.should eq "35.00"
end
it "calculates average when there are two builds with coverage and one with nil" do
FactoryGirl.create :build, name: "rspec", coverage: 30, commit: commit
FactoryGirl.create :build, name: "rubocop", coverage: 40, commit: commit
FactoryGirl.create :build, commit: commit
- commit.coverage.should == "35.00"
+ commit.coverage.should eq "35.00"
end
it "calculates average when there are two builds with coverage and one is retried" do
FactoryGirl.create :build, name: "rspec", coverage: 30, commit: commit
FactoryGirl.create :build, name: "rubocop", coverage: 30, commit: commit
FactoryGirl.create :build, name: "rubocop", coverage: 40, commit: commit
- commit.coverage.should == "35.00"
+ commit.coverage.should eq "35.00"
end
it "calculates average when there is one build without coverage" do
diff --git a/spec/models/mail_service_spec.rb b/spec/models/mail_service_spec.rb
index d66a659..a3879f1 100644
--- a/spec/models/mail_service_spec.rb
+++ b/spec/models/mail_service_spec.rb
@@ -148,7 +148,7 @@ describe MailService do
end
it do
- mail.can_test?.should == true
+ mail.can_test?.should eq true
end
end
diff --git a/spec/models/project_services/slack_message_spec.rb b/spec/models/project_services/slack_message_spec.rb
index 88e0f37..e599f56 100644
--- a/spec/models/project_services/slack_message_spec.rb
+++ b/spec/models/project_services/slack_message_spec.rb
@@ -19,7 +19,7 @@ describe SlackMessage do
it 'returns a message with succeeded build' do
build.update(status: "success")
- subject.color.should == color
+ subject.color.should eq color
subject.fallback.should include('Build')
subject.fallback.should include("\##{build.id}")
subject.fallback.should include('succeeded')
@@ -33,7 +33,7 @@ describe SlackMessage do
it 'returns a message with failed build' do
build.update(status: "failed")
- subject.color.should == color
+ subject.color.should eq color
subject.fallback.should include('Build')
subject.fallback.should include("\##{build.id}")
subject.fallback.should include('failed')
@@ -53,7 +53,7 @@ describe SlackMessage do
commit.builds.update_all(status: "success")
commit.reload
- subject.color.should == color
+ subject.color.should eq color
subject.fallback.should include('Commit')
subject.fallback.should include("\##{commit.id}")
subject.fallback.should include('succeeded')
@@ -71,12 +71,12 @@ describe SlackMessage do
first_build.update(status: "success")
second_build.update(status: "failed")
- subject.color.should == color
+ subject.color.should eq color
subject.fallback.should include('Commit')
subject.fallback.should include("\##{commit.id}")
subject.fallback.should include('failed')
- subject.attachments.first[:fields].size.should == 1
- subject.attachments.first[:fields].first[:title].should == second_build.name
+ subject.attachments.first[:fields].size.should eq 1
+ subject.attachments.first[:fields].first[:title].should eq second_build.name
subject.attachments.first[:fields].first[:value].should include("\##{second_build.id}")
end
end
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 82e30c7..b8d9870 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -39,12 +39,12 @@ describe Project do
describe 'before_validation' do
it 'should set an random token if none provided' do
project = FactoryGirl.create :project_without_token
- project.token.should_not == ""
+ project.token.should_not eq ""
end
it 'should not set an random toke if one provided' do
project = FactoryGirl.create :project
- project.token.should == "iPWx6WM4lhHNedGfBpPJNP"
+ project.token.should eq "iPWx6WM4lhHNedGfBpPJNP"
end
end
@@ -57,7 +57,7 @@ describe Project do
FactoryGirl.create :commit, committed_at: 1.hour.ago, project: newest_project
FactoryGirl.create :commit, committed_at: 2.hour.ago, project: oldest_project
- Project.ordered_by_last_commit_date.should == [newest_project, oldest_project, project_without_commits]
+ Project.ordered_by_last_commit_date.should eq [newest_project, oldest_project, project_without_commits]
end
end
@@ -70,26 +70,26 @@ describe Project do
FactoryGirl.create(:build, commit: commit)
end
- it { project.status.should == 'pending' }
+ it { project.status.should eq 'pending' }
it { project.last_commit.should be_kind_of(Commit) }
- it { project.human_status.should == 'pending' }
+ it { project.human_status.should eq 'pending' }
end
end
describe '#email_notification?' do
it do
project = FactoryGirl.create :project, email_add_pusher: true
- project.email_notification?.should == true
+ project.email_notification?.should eq true
end
it do
project = FactoryGirl.create :project, email_add_pusher: false, email_recipients: 'test tesft'
- project.email_notification?.should == true
+ project.email_notification?.should eq true
end
it do
project = FactoryGirl.create :project, email_add_pusher: false, email_recipients: ''
- project.email_notification?.should == false
+ project.email_notification?.should eq false
end
end
@@ -98,28 +98,28 @@ describe Project do
project = FactoryGirl.create :project, email_add_pusher: true
project.stub(:broken?).and_return(true)
project.stub(:success?).and_return(true)
- project.broken_or_success?.should == true
+ project.broken_or_success?.should eq true
}
it {
project = FactoryGirl.create :project, email_add_pusher: true
project.stub(:broken?).and_return(true)
project.stub(:success?).and_return(false)
- project.broken_or_success?.should == true
+ project.broken_or_success?.should eq true
}
it {
project = FactoryGirl.create :project, email_add_pusher: true
project.stub(:broken?).and_return(false)
project.stub(:success?).and_return(true)
- project.broken_or_success?.should == true
+ project.broken_or_success?.should eq true
}
it {
project = FactoryGirl.create :project, email_add_pusher: true
project.stub(:broken?).and_return(false)
project.stub(:success?).and_return(false)
- project.broken_or_success?.should == false
+ project.broken_or_success?.should eq false
}
end
diff --git a/spec/models/runner_spec.rb b/spec/models/runner_spec.rb
index 061fba8..0621a95 100644
--- a/spec/models/runner_spec.rb
+++ b/spec/models/runner_spec.rb
@@ -44,7 +44,7 @@ describe Runner do
before { shared_runner.assign_to(project) }
it { shared_runner.should be_specific }
- it { shared_runner.projects.should == [project] }
+ it { shared_runner.projects.should eq [project] }
it { shared_runner.only_for?(project).should be_truthy }
end
diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb
index 8a275bf..7158fdd 100644
--- a/spec/models/service_spec.rb
+++ b/spec/models/service_spec.rb
@@ -42,7 +42,7 @@ describe Service do
end
describe '#can_test' do
- it { @testable.should == true }
+ it { @testable.should eq true }
end
end
end
diff --git a/spec/models/trigger_spec.rb b/spec/models/trigger_spec.rb
index bba638e..6c327ec 100644
--- a/spec/models/trigger_spec.rb
+++ b/spec/models/trigger_spec.rb
@@ -11,7 +11,7 @@ describe Trigger do
it 'should not set an random token if one provided' do
trigger = FactoryGirl.create :trigger, project: project
- trigger.token.should == 'token'
+ trigger.token.should eq 'token'
end
end
end
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 6d3ad9f..73b361d 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -66,13 +66,13 @@ describe User do
it "returns projects" do
allow_any_instance_of(User).to receive(:can_manage_project?).and_return(true)
- user.authorized_projects.count.should == 2
+ user.authorized_projects.count.should eq 2
end
it "empty list if user miss manage permission" do
allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false)
- user.authorized_projects.count.should == 0
+ user.authorized_projects.count.should eq 0
end
end
diff --git a/spec/requests/api/builds_spec.rb b/spec/requests/api/builds_spec.rb
index be55e9f..b579b36 100644
--- a/spec/requests/api/builds_spec.rb
+++ b/spec/requests/api/builds_spec.rb
@@ -22,15 +22,15 @@ describe API::API do
post api("/builds/register"), token: runner.token, info: {platform: :darwin}
- response.status.should == 201
- json_response['sha'].should == build.sha
- runner.reload.platform.should == "darwin"
+ response.status.should eq 201
+ json_response['sha'].should eq build.sha
+ runner.reload.platform.should eq "darwin"
end
it "should return 404 error if no pending build found" do
post api("/builds/register"), token: runner.token
- response.status.should == 404
+ response.status.should eq 404
end
it "should return 404 error if no builds for specific runner" do
@@ -39,7 +39,7 @@ describe API::API do
post api("/builds/register"), token: runner.token
- response.status.should == 404
+ response.status.should eq 404
end
it "should return 404 error if no builds for shared runner" do
@@ -48,7 +48,7 @@ describe API::API do
post api("/builds/register"), token: shared_runner.token
- response.status.should == 404
+ response.status.should eq 404
end
it "returns options" do
@@ -57,8 +57,8 @@ describe API::API do
post api("/builds/register"), token: runner.token, info: {platform: :darwin}
- response.status.should == 201
- json_response["options"].should == {"image" => "ruby:2.1", "services" => ["postgres"]}
+ response.status.should eq 201
+ json_response["options"].should eq({"image" => "ruby:2.1", "services" => ["postgres"]})
end
it "returns variables" do
@@ -68,8 +68,8 @@ describe API::API do
post api("/builds/register"), token: runner.token, info: {platform: :darwin}
- response.status.should == 201
- json_response["variables"].should == [
+ response.status.should eq 201
+ json_response["variables"].should eq [
{"key" => "DB_NAME", "value" => "postgres", "public" => true},
{"key" => "SECRET_KEY", "value" => "secret_value", "public" => false},
]
@@ -85,8 +85,8 @@ describe API::API do
post api("/builds/register"), token: runner.token, info: {platform: :darwin}
- response.status.should == 201
- json_response["variables"].should == [
+ response.status.should eq 201
+ json_response["variables"].should eq [
{"key" => "DB_NAME", "value" => "postgres", "public" => true},
{"key" => "SECRET_KEY", "value" => "secret_value", "public" => false},
{"key" => "TRIGGER_KEY", "value" => "TRIGGER_VALUE", "public" => false},
@@ -101,7 +101,7 @@ describe API::API do
it "should update a running build" do
build.run!
put api("/builds/#{build.id}"), token: runner.token
- response.status.should == 200
+ response.status.should eq 200
end
it 'Should not override trace information when no trace is given' do
diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb
index 190df70..60763eb 100644
--- a/spec/requests/api/commits_spec.rb
+++ b/spec/requests/api/commits_spec.rb
@@ -19,10 +19,10 @@ describe API::API, 'Commits' do
it "should return commits per project" do
get api("/commits"), options
- response.status.should == 200
- json_response.count.should == 1
- json_response.first["project_id"].should == project.id
- json_response.first["sha"].should == commit.sha
+ response.status.should eq 200
+ json_response.count.should eq 1
+ json_response.first["project_id"].should eq project.id
+ json_response.first["sha"].should eq commit.sha
end
end
@@ -51,15 +51,15 @@ describe API::API, 'Commits' do
it "should create a build" do
post api("/commits"), options.merge(data: data)
- response.status.should == 201
- json_response['sha'].should == "da1560886d4f094c3e6c9ef40349f7d38b5d27d7"
+ response.status.should eq 201
+ json_response['sha'].should eq "da1560886d4f094c3e6c9ef40349f7d38b5d27d7"
end
it "should return 400 error if no data passed" do
post api("/commits"), options
- response.status.should == 400
- json_response['message'].should == "400 (Bad request) \"data\" not given"
+ response.status.should eq 400
+ json_response['message'].should eq "400 (Bad request) \"data\" not given"
end
end
end
diff --git a/spec/requests/api/forks_spec.rb b/spec/requests/api/forks_spec.rb
index af52342..1dd9c05 100644
--- a/spec/requests/api/forks_spec.rb
+++ b/spec/requests/api/forks_spec.rb
@@ -41,8 +41,8 @@ describe API::API do
it "should create a project with valid data" do
post api("/forks"), options
- response.status.should == 201
- json_response['name'].should == "Gitlab.org / Underscore"
+ response.status.should eq 201
+ json_response['name'].should eq "Gitlab.org / Underscore"
end
end
@@ -53,7 +53,7 @@ describe API::API do
it "should error with invalid data" do
post api("/forks"), options
- response.status.should == 400
+ response.status.should eq 400
end
end
end
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 8a744c1..290d7cf 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -25,10 +25,10 @@ describe API::API do
it "should return all projects on the CI instance" do
get api("/projects"), options
- response.status.should == 200
- json_response.count.should == 2
- json_response.first["id"].should == project1.id
- json_response.last["id"].should == project2.id
+ response.status.should eq 200
+ json_response.count.should eq 2
+ json_response.first["id"].should eq project1.id
+ json_response.last["id"].should eq project2.id
end
end
@@ -40,8 +40,8 @@ describe API::API do
it "should return all projects on the CI instance" do
get api("/projects/owned"), options
- response.status.should == 200
- json_response.count.should == 0
+ response.status.should eq 200
+ json_response.count.should eq 0
end
end
end
@@ -58,19 +58,19 @@ describe API::API do
it "should create webhook for specified project" do
post api("/projects/#{project.id}/webhooks"), options
- response.status.should == 201
- json_response["url"].should == webhook[:web_hook]
+ response.status.should eq 201
+ json_response["url"].should eq webhook[:web_hook]
end
it "fails to create webhook for non existsing project" do
post api("/projects/non-existant-id/webhooks"), options
- response.status.should == 404
+ response.status.should eq 404
end
it "non-manager is not authorized" do
allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false)
post api("/projects/#{project.id}/webhooks"), options
- response.status.should == 401
+ response.status.should eq 401
end
end
@@ -83,14 +83,14 @@ describe API::API do
it "fails to create webhook for not valid url" do
post api("/projects/#{project.id}/webhooks"), options
- response.status.should == 400
+ response.status.should eq 400
end
end
context "Missed web_hook parameter" do
it "fails to create webhook for not provided url" do
post api("/projects/#{project.id}/webhooks"), options
- response.status.should == 400
+ response.status.should eq 400
end
end
end
@@ -101,15 +101,15 @@ describe API::API do
context "with an existing project" do
it "should retrieve the project info" do
get api("/projects/#{project.id}"), options
- response.status.should == 200
- json_response['id'].should == project.id
+ response.status.should eq 200
+ json_response['id'].should eq project.id
end
end
context "with a non-existing project" do
it "should return 404 error if project not found" do
get api("/projects/non_existent_id"), options
- response.status.should == 404
+ response.status.should eq 404
end
end
end
@@ -124,19 +124,19 @@ describe API::API do
it "should update a specific project's information" do
put api("/projects/#{project.id}"), options
- response.status.should == 200
- json_response["name"].should == project_info[:name]
+ response.status.should eq 200
+ json_response["name"].should eq project_info[:name]
end
it "fails to update a non-existing project" do
put api("/projects/non-existant-id"), options
- response.status.should == 404
+ response.status.should eq 404
end
it "non-manager is not authorized" do
allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false)
put api("/projects/#{project.id}"), options
- response.status.should == 401
+ response.status.should eq 401
end
end
@@ -145,7 +145,7 @@ describe API::API do
it "should delete a specific project" do
delete api("/projects/#{project.id}"), options
- response.status.should == 200
+ response.status.should eq 200
expect { project.reload }.to raise_error(ActiveRecord::RecordNotFound)
end
@@ -153,12 +153,12 @@ describe API::API do
it "non-manager is not authorized" do
allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false)
delete api("/projects/#{project.id}"), options
- response.status.should == 401
+ response.status.should eq 401
end
it "is getting not found error" do
delete api("/projects/not-existing_id"), options
- response.status.should == 404
+ response.status.should eq 404
end
end
@@ -181,8 +181,8 @@ describe API::API do
it "should create a project with valid data" do
post api("/projects"), options
- response.status.should == 201
- json_response['name'].should == project_info[:name]
+ response.status.should eq 201
+ json_response['name'].should eq project_info[:name]
end
end
@@ -193,7 +193,7 @@ describe API::API do
it "should error with invalid data" do
post api("/projects"), options
- response.status.should == 400
+ response.status.should eq 400
end
end
@@ -203,24 +203,24 @@ describe API::API do
it "should add the project to the runner" do
post api("/projects/#{project.id}/runners/#{runner.id}"), options
- response.status.should == 201
+ response.status.should eq 201
project.reload
- project.runners.first.id.should == runner.id
+ project.runners.first.id.should eq runner.id
end
it "should fail if it tries to link a non-existing project or runner" do
post api("/projects/#{project.id}/runners/non-existing"), options
- response.status.should == 404
+ response.status.should eq 404
post api("/projects/non-existing/runners/#{runner.id}"), options
- response.status.should == 404
+ response.status.should eq 404
end
it "non-manager is not authorized" do
allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false)
post api("/projects/#{project.id}/runners/#{runner.id}"), options
- response.status.should == 401
+ response.status.should eq 401
end
end
@@ -235,7 +235,7 @@ describe API::API do
it "should remove the project from the runner" do
project.runners.should be_present
delete api("/projects/#{project.id}/runners/#{runner.id}"), options
- response.status.should == 200
+ response.status.should eq 200
project.reload
project.runners.should be_empty
@@ -244,7 +244,7 @@ describe API::API do
it "non-manager is not authorized" do
allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false)
post api("/projects/#{project.id}/runners/#{runner.id}"), options
- response.status.should == 401
+ response.status.should eq 401
end
end
end
diff --git a/spec/requests/api/runners_spec.rb b/spec/requests/api/runners_spec.rb
index 47de3c2..a6fc43c 100644
--- a/spec/requests/api/runners_spec.rb
+++ b/spec/requests/api/runners_spec.rb
@@ -24,8 +24,8 @@ describe API::API do
it "should retrieve a list of all runners" do
get api("/runners"), options
- response.status.should == 200
- json_response.count.should == 5
+ response.status.should eq 200
+ json_response.count.should eq 5
json_response.last.should have_key("id")
json_response.last.should have_key("token")
end
@@ -35,41 +35,41 @@ describe API::API do
describe "should create a runner if token provided" do
before { post api("/runners/register"), token: GitlabCi::REGISTRATION_TOKEN }
- it { response.status.should == 201 }
+ it { response.status.should eq 201 }
end
describe "should create a runner with description" do
before { post api("/runners/register"), token: GitlabCi::REGISTRATION_TOKEN, description: "server.hostname" }
- it { response.status.should == 201 }
- it { Runner.first.description.should == "server.hostname" }
+ it { response.status.should eq 201 }
+ it { Runner.first.description.should eq "server.hostname" }
end
describe "should create a runner with tags" do
before { post api("/runners/register"), token: GitlabCi::REGISTRATION_TOKEN, tag_list: "tag1, tag2" }
- it { response.status.should == 201 }
- it { Runner.first.tag_list.sort.should == ["tag1", "tag2"] }
+ it { response.status.should eq 201 }
+ it { Runner.first.tag_list.sort.should eq ["tag1", "tag2"] }
end
describe "should create a runner if project token provided" do
let(:project) { FactoryGirl.create(:project) }
before { post api("/runners/register"), token: project.token }
- it { response.status.should == 201 }
- it { project.runners.size.should == 1 }
+ it { response.status.should eq 201 }
+ it { project.runners.size.should eq 1 }
end
it "should return 403 error if token is invalid" do
post api("/runners/register"), token: 'invalid'
- response.status.should == 403
+ response.status.should eq 403
end
it "should return 400 error if no token" do
post api("/runners/register")
- response.status.should == 400
+ response.status.should eq 400
end
end
@@ -77,7 +77,7 @@ describe API::API do
let!(:runner) { FactoryGirl.create(:runner) }
before { delete api("/runners/delete"), token: runner.token }
- it { response.status.should == 200 }
- it { Runner.count.should == 0 }
+ it { response.status.should eq 200 }
+ it { Runner.count.should eq 0 }
end
end
diff --git a/spec/requests/api/triggers_spec.rb b/spec/requests/api/triggers_spec.rb
index 6e56c4b..fc7394c 100644
--- a/spec/requests/api/triggers_spec.rb
+++ b/spec/requests/api/triggers_spec.rb
@@ -17,17 +17,17 @@ describe API::API do
context 'Handles errors' do
it 'should return bad request if token is missing' do
post api("/projects/#{project.id}/refs/master/trigger")
- response.status.should == 400
+ response.status.should eq 400
end
it 'should return not found if project is not found' do
post api('/projects/0/refs/master/trigger'), options
- response.status.should == 404
+ response.status.should eq 404
end
it 'should return unauthorized if token is for different project' do
post api("/projects/#{project2.id}/refs/master/trigger"), options
- response.status.should == 401
+ response.status.should eq 401
end
end
@@ -38,15 +38,15 @@ describe API::API do
it 'should create builds' do
post api("/projects/#{project.id}/refs/master/trigger"), options
- response.status.should == 201
+ response.status.should eq 201
@commit.builds.reload
- @commit.builds.size.should == 2
+ @commit.builds.size.should eq 2
end
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
- response.status.should == 400
- json_response['message'].should == 'No builds created'
+ response.status.should eq 400
+ json_response['message'].should eq 'No builds created'
end
context 'Validates variables' do
@@ -56,21 +56,21 @@ describe API::API do
it 'should validate variables to be a hash' do
post api("/projects/#{project.id}/refs/master/trigger"), options.merge(variables: 'value')
- response.status.should == 400
- json_response['message'].should == 'variables needs to be a hash'
+ response.status.should eq 400
+ json_response['message'].should eq 'variables needs to be a hash'
end
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)})
- response.status.should == 400
- json_response['message'].should == 'variables needs to be a map of key-valued strings'
+ response.status.should eq 400
+ json_response['message'].should eq 'variables needs to be a map of key-valued strings'
end
it 'create trigger request with variables' do
post api("/projects/#{project.id}/refs/master/trigger"), options.merge(variables: variables)
- response.status.should == 201
+ response.status.should eq 201
@commit.builds.reload
- @commit.builds.first.trigger_request.variables.should == variables
+ @commit.builds.first.trigger_request.variables.should eq variables
end
end
end
diff --git a/spec/requests/builds_spec.rb b/spec/requests/builds_spec.rb
index 73d540e..a245087 100644
--- a/spec/requests/builds_spec.rb
+++ b/spec/requests/builds_spec.rb
@@ -12,7 +12,7 @@ describe "Builds" do
get status_project_build_path(@project, @build), format: :json
end
- it { response.status.should == 200 }
+ it { response.status.should eq 200 }
it { response.body.should include(@build.sha) }
end
end
diff --git a/spec/requests/commits_spec.rb b/spec/requests/commits_spec.rb
index e9d8366..e257997 100644
--- a/spec/requests/commits_spec.rb
+++ b/spec/requests/commits_spec.rb
@@ -11,7 +11,7 @@ describe "Commits" do
get status_project_ref_commit_path(@project, @commit.ref, @commit.sha), format: :json
end
- it { response.status.should == 200 }
+ it { response.status.should eq 200 }
it { response.body.should include(@commit.sha) }
end
end
diff --git a/spec/services/create_commit_service_spec.rb b/spec/services/create_commit_service_spec.rb
index 8d8996c..4a0aa60 100644
--- a/spec/services/create_commit_service_spec.rb
+++ b/spec/services/create_commit_service_spec.rb
@@ -19,7 +19,7 @@ describe CreateCommitService do
it { commit.should be_kind_of(Commit) }
it { commit.should be_valid }
it { commit.should be_persisted }
- it { commit.should == project.commits.last }
+ it { commit.should eq project.commits.last }
it { commit.builds.first.should be_kind_of(Build) }
end
@@ -60,7 +60,7 @@ describe CreateCommitService do
ci_yaml_file: gitlab_ci_yaml
)
commit.builds.any?.should be_falsey
- commit.status.should == "skipped"
+ commit.status.should eq "skipped"
end
it "does not skips builds creation if there is no [ci skip] tag in commit message" do
@@ -74,7 +74,7 @@ describe CreateCommitService do
ci_yaml_file: gitlab_ci_yaml
)
- commit.builds.first.name.should == "staging"
+ commit.builds.first.name.should eq "staging"
end
it "skips builds creation if there is [ci skip] tag in commit message and yaml is invalid" do
@@ -87,7 +87,7 @@ describe CreateCommitService do
ci_yaml_file: "invalid: file"
)
commit.builds.any?.should be_falsey
- commit.status.should == "skipped"
+ commit.status.should eq "skipped"
end
end
@@ -100,7 +100,7 @@ describe CreateCommitService do
commits: commits,
ci_yaml_file: gitlab_ci_yaml
)
- commit.builds.count(:all).should == 2
+ commit.builds.count(:all).should eq 2
commit = service.execute(project,
ref: 'refs/heads/master',
@@ -109,7 +109,7 @@ describe CreateCommitService do
commits: commits,
ci_yaml_file: gitlab_ci_yaml
)
- commit.builds.count(:all).should == 2
+ commit.builds.count(:all).should eq 2
end
it "creates commit with failed status if yaml is invalid" do
@@ -123,7 +123,7 @@ describe CreateCommitService do
ci_yaml_file: "invalid: file"
)
- commit.status.should == "failed"
+ commit.status.should eq "failed"
commit.builds.any?.should be_falsey
end
end
diff --git a/spec/services/create_trigger_request_service_spec.rb b/spec/services/create_trigger_request_service_spec.rb
index 2e204a2..66af064 100644
--- a/spec/services/create_trigger_request_service_spec.rb
+++ b/spec/services/create_trigger_request_service_spec.rb
@@ -14,7 +14,7 @@ describe CreateTriggerRequestService do
end
it { subject.should be_kind_of(TriggerRequest) }
- it { subject.commit.should == @commit }
+ it { subject.commit.should eq @commit }
end
context 'no commit for ref' do
@@ -45,7 +45,7 @@ describe CreateTriggerRequestService do
context 'retries latest one' do
it { subject.should be_kind_of(TriggerRequest) }
it { subject.should be_persisted }
- it { subject.commit.should == @commit2 }
+ it { subject.commit.should eq @commit2 }
end
end
end
diff --git a/spec/services/event_service_spec.rb b/spec/services/event_service_spec.rb
index 67ad57a..0b257b4 100644
--- a/spec/services/event_service_spec.rb
+++ b/spec/services/event_service_spec.rb
@@ -12,7 +12,7 @@ describe EventService do
it "creates event" do
EventService.new.remove_project(user, project)
- Event.admin.last.description.should == "Project \"GitLab / gitlab-shell\" has been removed by root"
+ Event.admin.last.description.should eq "Project \"GitLab / gitlab-shell\" has been removed by root"
end
end
@@ -20,7 +20,7 @@ describe EventService do
it "creates event" do
EventService.new.create_project(user, project)
- Event.admin.last.description.should == "Project \"GitLab / gitlab-shell\" has been created by root"
+ Event.admin.last.description.should eq "Project \"GitLab / gitlab-shell\" has been created by root"
end
end
@@ -28,7 +28,7 @@ describe EventService do
it "creates event" do
EventService.new.change_project_settings(user, project)
- Event.last.description.should == "User \"root\" updated projects settings"
+ Event.last.description.should eq "User \"root\" updated projects settings"
end
end
end
diff --git a/spec/services/image_for_build_service_spec.rb b/spec/services/image_for_build_service_spec.rb
index 1de27d9..06a1582 100644
--- a/spec/services/image_for_build_service_spec.rb
+++ b/spec/services/image_for_build_service_spec.rb
@@ -15,7 +15,7 @@ describe ImageForBuildService do
it { image.should be_kind_of(OpenStruct) }
it { image.path.to_s.should include('public/build-running.svg') }
- it { image.name.should == 'build-running.svg' }
+ it { image.name.should eq 'build-running.svg' }
end
context 'unknown branch name' do
@@ -23,7 +23,7 @@ describe ImageForBuildService do
it { image.should be_kind_of(OpenStruct) }
it { image.path.to_s.should include('public/build-unknown.svg') }
- it { image.name.should == 'build-unknown.svg' }
+ it { image.name.should eq 'build-unknown.svg' }
end
context 'commit sha' do
@@ -32,7 +32,7 @@ describe ImageForBuildService do
it { image.should be_kind_of(OpenStruct) }
it { image.path.to_s.should include('public/build-running.svg') }
- it { image.name.should == 'build-running.svg' }
+ it { image.name.should eq 'build-running.svg' }
end
context 'unknown commit sha' do
@@ -40,7 +40,7 @@ describe ImageForBuildService do
it { image.should be_kind_of(OpenStruct) }
it { image.path.to_s.should include('public/build-unknown.svg') }
- it { image.name.should == 'build-unknown.svg' }
+ it { image.name.should eq 'build-unknown.svg' }
end
end
end
diff --git a/spec/services/register_build_service_spec.rb b/spec/services/register_build_service_spec.rb
index db9b717..906e7ee 100644
--- a/spec/services/register_build_service_spec.rb
+++ b/spec/services/register_build_service_spec.rb
@@ -18,7 +18,7 @@ describe RegisterBuildService do
pending_build.tag_list = ["linux"]
pending_build.save
specific_runner.tag_list = ["linux"]
- service.execute(specific_runner).should == pending_build
+ service.execute(specific_runner).should eq pending_build
end
it "does not pick build with different tag" do
@@ -29,7 +29,7 @@ describe RegisterBuildService do
end
it "picks build without tag" do
- service.execute(specific_runner).should == pending_build
+ service.execute(specific_runner).should eq pending_build
end
it "does not pick build with tag" do
@@ -40,7 +40,7 @@ describe RegisterBuildService do
it "pick build without tag" do
specific_runner.tag_list = ["win32"]
- service.execute(specific_runner).should == pending_build
+ service.execute(specific_runner).should eq pending_build
end
end
@@ -56,7 +56,7 @@ describe RegisterBuildService do
it { build.should be_kind_of(Build) }
it { build.should be_valid }
it { build.should be_running }
- it { build.runner.should == shared_runner }
+ it { build.runner.should eq shared_runner }
end
context 'specific runner' do
@@ -65,7 +65,7 @@ describe RegisterBuildService do
it { build.should be_kind_of(Build) }
it { build.should be_valid }
it { build.should be_running }
- it { build.runner.should == specific_runner }
+ it { build.runner.should eq specific_runner }
end
end
@@ -82,7 +82,7 @@ describe RegisterBuildService do
it { build.should be_kind_of(Build) }
it { build.should be_valid }
it { build.should be_running }
- it { build.runner.should == specific_runner }
+ it { build.runner.should eq specific_runner }
end
end
end