diff options
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/build_spec.rb | 22 | ||||
-rw-r--r-- | spec/models/commit_spec.rb | 24 | ||||
-rw-r--r-- | spec/models/network_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/project_services/hip_chat_message_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/runner_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/user_spec.rb | 4 |
7 files changed, 37 insertions, 37 deletions
diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb index 7333981..ea6b08a 100644 --- a/spec/models/build_spec.rb +++ b/spec/models/build_spec.rb @@ -69,14 +69,14 @@ describe Build do context 'without started_at' do before { build.started_at = nil } - it { should be_false } + it { should be_falsey } end %w(running success failed).each do |status| context "if build status is #{status}" do before { build.status = status } - it { should be_true } + it { should be_truthy } end end @@ -84,7 +84,7 @@ describe Build do context "if build status is #{status}" do before { build.status = status } - it { should be_false } + it { should be_falsey } end end end @@ -96,7 +96,7 @@ describe Build do context "if build.status is #{state}" do before { build.status = state } - it { should be_true } + it { should be_truthy } end end @@ -104,7 +104,7 @@ describe Build do context "if build.status is #{state}" do before { build.status = state } - it { should be_false } + it { should be_falsey } end end end @@ -116,7 +116,7 @@ describe Build do context "if build.status is #{state}" do before { build.status = state } - it { should be_true } + it { should be_truthy } end end @@ -124,7 +124,7 @@ describe Build do context "if build.status is #{state}" do before { build.status = state } - it { should be_false } + it { should be_falsey } end end end @@ -138,13 +138,13 @@ describe Build do context 'and build.status is success' do before { build.status = 'success' } - it { should be_false } + it { should be_falsey } end context 'and build.status is failed' do before { build.status = 'failed' } - it { should be_false } + it { should be_falsey } end end @@ -154,13 +154,13 @@ describe Build do context 'and build.status is success' do before { build.status = 'success' } - it { should be_false } + it { should be_falsey } end context 'and build.status is failed' do before { build.status = 'failed' } - it { should be_true } + it { should be_truthy } end end end diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 6f644d2..e0dd6fb 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -116,7 +116,7 @@ describe Commit do subject { commit_with_project.compare? } context 'if commit.before_sha are not nil' do - it { should be_true } + it { should be_truthy } end end @@ -140,19 +140,19 @@ describe Commit do end it "creates builds for next type" do - commit.create_builds.should be_true + commit.create_builds.should be_truthy commit.builds.reload commit.builds.size.should == 2 - commit.create_next_builds(nil).should be_true + commit.create_next_builds(nil).should be_truthy commit.builds.reload commit.builds.size.should == 4 - commit.create_next_builds(nil).should be_true + commit.create_next_builds(nil).should be_truthy commit.builds.reload commit.builds.size.should == 5 - commit.create_next_builds(nil).should be_false + commit.create_next_builds(nil).should be_falsey end end @@ -162,7 +162,7 @@ describe Commit do end it 'creates builds' do - commit.create_builds.should be_true + commit.create_builds.should be_truthy commit.builds.reload commit.builds.size.should == 2 end @@ -172,27 +172,27 @@ describe Commit do let(:trigger_request) { FactoryGirl.create :trigger_request, commit: commit, trigger: trigger } it 'creates builds' do - commit.create_builds(trigger_request).should be_true + commit.create_builds(trigger_request).should be_truthy commit.builds.reload commit.builds.size.should == 2 end it 'rebuilds commit' do - commit.create_builds.should be_true + commit.create_builds.should be_truthy commit.builds.reload commit.builds.size.should == 2 - commit.create_builds(trigger_request).should be_true + commit.create_builds(trigger_request).should be_truthy commit.builds.reload commit.builds.size.should == 4 end it 'creates next builds' do - commit.create_builds(trigger_request).should be_true + commit.create_builds(trigger_request).should be_truthy commit.builds.reload commit.builds.size.should == 2 - commit.create_next_builds(trigger_request).should be_true + commit.create_next_builds(trigger_request).should be_truthy commit.builds.reload commit.builds.size.should == 4 end @@ -205,7 +205,7 @@ describe Commit do it 'rebuilds commit' do commit.status.should == 'skipped' - commit.create_builds(trigger_request).should be_true + commit.create_builds(trigger_request).should be_truthy commit.builds.reload commit.builds.size.should == 2 commit.status.should == 'pending' diff --git a/spec/models/network_spec.rb b/spec/models/network_spec.rb index b80adba..dc8f89d 100644 --- a/spec/models/network_spec.rb +++ b/spec/models/network_spec.rb @@ -13,7 +13,7 @@ describe Network do network.class.stub(:put) { response } end - it { should be_true } + it { should be_truthy } end context 'on failure' do diff --git a/spec/models/project_services/hip_chat_message_spec.rb b/spec/models/project_services/hip_chat_message_spec.rb index f1ad875..c2aedd9 100644 --- a/spec/models/project_services/hip_chat_message_spec.rb +++ b/spec/models/project_services/hip_chat_message_spec.rb @@ -18,7 +18,7 @@ describe HipChatMessage do build.update(status: "success") expect( subject.status_color ).to eq 'green' - expect( subject.notify? ).to be_false + expect( subject.notify? ).to be_falsey expect( subject.to_s ).to match(/Build '[^']+' #\d+/) expect( subject.to_s ).to match(/Successful in \d+ second\(s\)\./) end @@ -29,7 +29,7 @@ describe HipChatMessage do build.update(status: "failed") expect( subject.status_color ).to eq 'red' - expect( subject.notify? ).to be_true + expect( subject.notify? ).to be_truthy expect( subject.to_s ).to match(/Build '[^']+' #\d+/) expect( subject.to_s ).to match(/Failed in \d+ second\(s\)\./) end @@ -50,7 +50,7 @@ describe HipChatMessage do commit.reload expect( subject.status_color ).to eq 'green' - expect( subject.notify? ).to be_false + expect( subject.notify? ).to be_falsey expect( subject.to_s ).to match(/Commit #\d+/) expect( subject.to_s ).to match(/Successful in \d+ second\(s\)\./) end @@ -65,7 +65,7 @@ describe HipChatMessage do second_build.update(status: "failed") expect( subject.status_color ).to eq 'red' - expect( subject.notify? ).to be_true + expect( subject.notify? ).to be_truthy expect( subject.to_s ).to match(/Commit #\d+/) expect( subject.to_s ).to match(/Failed in \d+ second\(s\)\./) end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index aa76b99..ee8719f 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -161,25 +161,25 @@ describe Project do describe :any_runners do it "there are no runners available" do project = FactoryGirl.create(:project) - project.any_runners?.should be_false + project.any_runners?.should be_falsey end it "there is a specific runner" do project = FactoryGirl.create(:project) project.runners << FactoryGirl.create(:specific_runner) - project.any_runners?.should be_true + project.any_runners?.should be_truthy end it "there is a shared runner" do project = FactoryGirl.create(:project, shared_runners_enabled: true) FactoryGirl.create(:shared_runner) - project.any_runners?.should be_true + project.any_runners?.should be_truthy end it "there is a shared runner, but they are prohibited to use" do project = FactoryGirl.create(:project) FactoryGirl.create(:shared_runner) - project.any_runners?.should be_false + project.any_runners?.should be_falsey end end end diff --git a/spec/models/runner_spec.rb b/spec/models/runner_spec.rb index 6902c0a..4ccad87 100644 --- a/spec/models/runner_spec.rb +++ b/spec/models/runner_spec.rb @@ -45,7 +45,7 @@ describe Runner do it { shared_runner.should be_specific } it { shared_runner.projects.should == [project] } - it { shared_runner.only_for?(project).should be_true } + it { shared_runner.only_for?(project).should be_truthy } end describe "belongs_to_one_project?" do @@ -56,7 +56,7 @@ describe Runner do project.runners << runner project1.runners << runner - runner.belongs_to_one_project?.should be_false + runner.belongs_to_one_project?.should be_falsey end it "returns true" do @@ -64,7 +64,7 @@ describe Runner do project = FactoryGirl.create(:project) project.runners << runner - runner.belongs_to_one_project?.should be_true + runner.belongs_to_one_project?.should be_truthy end end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 5c1a26f..6d3ad9f 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -42,13 +42,13 @@ describe User do it "returns false for reporter" do @user.stub(:project_info).and_return(project_with_reporter_access) - @user.has_developer_access?(1).should be_false + @user.has_developer_access?(1).should be_falsey end it "returns true for owner" do @user.stub(:project_info).and_return(project_with_owner_access) - @user.has_developer_access?(1).should be_true + @user.has_developer_access?(1).should be_truthy end end |