Commit e538963d authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add test for using overridden status method with scopes

parent 26092b51
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment