Skip to content

Commit

Permalink
Fix flaky spec in NotificationAvatarsComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
Dany Marcoux committed Feb 23, 2022
1 parent 15a4d1e commit 20b9e32
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

before do
# Easier to spec without having to create lots of data
stub_const('NotificationAvatarsComponent::MAXIMUM_DISPLAYED_AVATARS', 1)
# Interpolating described_class to prevent a flaky spec (https://github.com/rspec/rspec-mocks/pull/201#issuecomment-188533226)
stub_const("#{described_class}::MAXIMUM_DISPLAYED_AVATARS", 1)

# Comment which was already read (it's older than the notification), so it's not taken into account in the notification
create(:comment, commentable: project, updated_at: DateTime.yesterday)
Expand Down

0 comments on commit 20b9e32

Please sign in to comment.