diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-12-03 14:06:07 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-12-08 19:28:58 +0100 |
commit | 9b4e45c35253a397f3ff79207736280293848bf9 (patch) | |
tree | 678aa6b746880635f247fe016345e6dc7e9bf5e5 | |
parent | 44374434b5a0b4297686d5388f1124eda3adcbff (diff) | |
download | gitlab-ce-9b4e45c35253a397f3ff79207736280293848bf9.tar.gz |
Check for explicit true or false in specs
-rw-r--r-- | spec/models/project_spec.rb | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index b4b9d921ba4..606636e9d58 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -2574,7 +2574,7 @@ describe Project do end it 'returns false' do - is_expected.to be_falsey + is_expected.to be false end end @@ -2584,7 +2584,7 @@ describe Project do end it 'returns true' do - is_expected.to be_truthy + is_expected.to be true end end @@ -2594,7 +2594,7 @@ describe Project do end it 'returns true' do - is_expected.to be_truthy + is_expected.to be true end end @@ -2602,7 +2602,7 @@ describe Project do let(:ref) { nil } it 'returns false' do - is_expected.to be_falsey + is_expected.to be false end end @@ -2637,6 +2637,14 @@ describe Project do it_behaves_like 'ref is protected tag' end + + context 'when ref does not exist' do + let(:ref) { 'something' } + + it 'returns false' do + is_expected.to be false + end + end end context 'when ref is full ref' do @@ -2667,7 +2675,7 @@ describe Project do context 'when ref is not protected' do it 'returns false' do - is_expected.to be_falsey + is_expected.to be false end end @@ -2677,10 +2685,18 @@ describe Project do end it 'returns true' do - is_expected.to be_truthy + is_expected.to be true end end end + + context 'when ref does not exist' do + let(:ref) { 'refs/heads/something' } + + it 'returns false' do + is_expected.to be false + end + end end end |