diff options
Diffstat (limited to 'spec/models/resource_label_event_spec.rb')
-rw-r--r-- | spec/models/resource_label_event_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/resource_label_event_spec.rb b/spec/models/resource_label_event_spec.rb index 44de83d9240..5087a8e8524 100644 --- a/spec/models/resource_label_event_spec.rb +++ b/spec/models/resource_label_event_spec.rb @@ -144,4 +144,14 @@ RSpec.describe ResourceLabelEvent, type: :model do create(:resource_label_event, issue: issue, label: label) end end + + describe '#discussion_id' do + it 'generates different discussion ID for events created milliseconds apart' do + now = Time.current + event_1 = create(:resource_label_event, issue: issue, label: label, user: issue.author, created_at: now) + event_2 = create(:resource_label_event, issue: issue, label: label, user: issue.author, created_at: now.advance(seconds: 0.001)) + + expect(event_1.discussion_id).not_to eq(event_2.discussion_id) + end + end end |