diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-05-08 14:32:14 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-06-20 15:32:29 +0200 |
commit | e538963d80872e3844ba345967cfa0bf3821c82a (patch) | |
tree | 1287e859e25b2b2ad65bf16d98710a129c8288f3 /spec/models/commit_status_spec.rb | |
parent | 26092b5158d61f353b66a38d5034f3cb6e567ffa (diff) | |
download | gitlab-ce-e538963d80872e3844ba345967cfa0bf3821c82a.tar.gz |
Add test for using overridden status method with scopes
Diffstat (limited to 'spec/models/commit_status_spec.rb')
-rw-r--r-- | spec/models/commit_status_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/commit_status_spec.rb b/spec/models/commit_status_spec.rb index 2ee9620228c..dc348f6cd33 100644 --- a/spec/models/commit_status_spec.rb +++ b/spec/models/commit_status_spec.rb @@ -306,6 +306,17 @@ describe CommitStatus, :models do expect(described_class.all.status).to eq 'success' end end + + context 'when using a scope to select latest statuses' do + before do + create_status(name: 'test', status: 'failed') + create_status(allow_failure: true, name: 'test', status: 'failed') + end + + it 'returns status according to the scope' do + expect(described_class.latest.status).to eq 'success' + end + end end describe '#before_sha' do |