diff options
-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 |