Skip to content
Snippets Groups Projects
Verified Commit 08ae49de authored by Mark Chao's avatar Mark Chao :island: Committed by GitLab
Browse files

Merge branch 'el-quarantine-flaky-test' into 'master'

Use be_within matcher to avoid test flakiness

See merge request !143157



Merged-by: Mark Chao's avatarMark Chao <mchao@gitlab.com>
Approved-by: Mark Chao's avatarMark Chao <mchao@gitlab.com>
Approved-by: Marc Saleiko's avatarMarc Saleiko <msaleiko@gitlab.com>
Co-authored-by: default avatarEugie Limpin <elimpin@gitlab.com>
parents 6dfa2710 92b02d93
No related branches found
No related tags found
2 merge requests!144312Change service start (cut-off) date for code suggestions to March 15th,!143157Use be_within matcher to avoid test flakiness
Pipeline #1158745381 passed
......@@ -402,12 +402,15 @@
it_behaves_like 'it returns a success response'
it 'increments sms_send_count and sets sms_sent_at' do
old_values = [1, old_sms_sent_at.to_i]
new_values = [2, (old_sms_sent_at + 5.minutes).to_i]
it 'increments sms_send_count and sets sms_sent_at', :aggregate_failures do
expect(record.sms_send_count).to eq 1
expect(record.sms_sent_at).to be_within(1.second).of(old_sms_sent_at)
expect { service.execute }.to change { [record.reload.sms_send_count, record.reload.sms_sent_at.to_i] }
.from(old_values).to(new_values)
service.execute
record.reload
expect(record.sms_send_count).to eq 2
expect(record.sms_sent_at).to be_within(1.second).of(old_sms_sent_at + 5.minutes)
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment