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

`be_(false|true)` -> `be_(falsey|truthy)`

parent fda96b4b
No related branches found
No related tags found
No related merge requests found
Showing with 54 additions and 54 deletions
Loading
Loading
@@ -60,7 +60,7 @@ describe "Runners" do
click_on "Remove runner"
end
 
Runner.exists?(id: @specific_runner).should be_false
Runner.exists?(id: @specific_runner).should be_falsey
end
end
 
Loading
Loading
@@ -75,7 +75,7 @@ describe "Runners" do
 
click_on "Enable shared runners"
 
@project.reload.shared_runners_enabled.should be_true
@project.reload.shared_runners_enabled.should be_truthy
end
end
 
Loading
Loading
Loading
Loading
@@ -53,17 +53,17 @@ describe UserSessionsHelper do
let (:invalid3) { 'aa:bb:' }
 
it 'should validate oauth state' do
is_oauth_state_valid?(state).should be_true
is_oauth_state_valid?(state).should be_truthy
end
 
it 'should not validate forged state' do
is_oauth_state_valid?(forged).should be_false
is_oauth_state_valid?(forged).should be_falsey
end
 
it 'should not validate invalid state' do
is_oauth_state_valid?(invalid).should be_false
is_oauth_state_valid?(invalid2).should be_false
is_oauth_state_valid?(invalid3).should be_false
is_oauth_state_valid?(invalid).should be_falsey
is_oauth_state_valid?(invalid2).should be_falsey
is_oauth_state_valid?(invalid3).should be_falsey
end
end
end
Loading
Loading
@@ -11,7 +11,7 @@ describe Upgrader do
describe 'latest_version?' do
it 'should be true if newest version' do
upgrader.stub(latest_version_raw: current_version)
upgrader.latest_version?.should be_true
upgrader.latest_version?.should be_truthy
end
end
 
Loading
Loading
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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'
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
Loading
Loading
@@ -59,7 +59,7 @@ describe CreateCommitService do
commits: commits,
ci_yaml_file: gitlab_ci_yaml
)
commit.builds.any?.should be_false
commit.builds.any?.should be_falsey
commit.status.should == "skipped"
end
 
Loading
Loading
@@ -86,7 +86,7 @@ describe CreateCommitService do
commits: commits,
ci_yaml_file: "invalid: file"
)
commit.builds.any?.should be_false
commit.builds.any?.should be_falsey
commit.status.should == "skipped"
end
end
Loading
Loading
@@ -124,7 +124,7 @@ describe CreateCommitService do
)
 
commit.status.should == "failed"
commit.builds.any?.should be_false
commit.builds.any?.should be_falsey
end
end
end
Loading
Loading
@@ -31,9 +31,9 @@ describe CreateProjectService do
 
project = service.execute(current_user, project_dump, 'http://localhost/projects/:project_id', origin_project)
 
project.shared_runners_enabled.should be_true
project.public.should be_true
project.allow_git_fetch.should be_true
project.shared_runners_enabled.should be_truthy
project.public.should be_truthy
project.allow_git_fetch.should be_truthy
end
end
end
Loading
Loading
Loading
Loading
@@ -25,7 +25,7 @@ describe RegisterBuildService do
pending_build.tag_list = ["linux"]
pending_build.save
specific_runner.tag_list = ["win32"]
service.execute(specific_runner).should be_false
service.execute(specific_runner).should be_falsey
end
 
it "picks build without tag" do
Loading
Loading
@@ -35,7 +35,7 @@ describe RegisterBuildService do
it "does not pick build with tag" do
pending_build.tag_list = ["linux"]
pending_build.save
service.execute(specific_runner).should be_false
service.execute(specific_runner).should be_falsey
end
 
it "pick build without tag" do
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ describe WebHookService do
describe :execute do
it "should execute successfully" do
stub_request(:post, hook.url).to_return(status: 200)
WebHookService.new.build_end(build).should be_true
WebHookService.new.build_end(build).should be_truthy
end
end
 
Loading
Loading
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