Fix a transient spec failure

Sorting by created_at can lead to uncertainties if two records are
created at the same time.

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2016-11-29 15:56:50 +01:00
parent a7a3636de2
commit 46859cb984
No known key found for this signature in database
GPG Key ID: 46DF07E5CD9E96AB
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ describe 'cycle analytics events' do
expect(json_response['events']).not_to be_empty
first_mr_iid = MergeRequest.order(created_at: :desc).pluck(:iid).first.to_s
first_mr_iid = project.merge_requests.order(id: :desc).pluck(:iid).first.to_s
expect(json_response['events'].first['iid']).to eq(first_mr_iid)
end