summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models')
-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
8 files changed, 44 insertions, 44 deletions
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