Skip to content

Commit

Permalink
correct erratic spec
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSaffron committed Aug 24, 2017
1 parent 512858c commit f60a1b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/models/user_spec.rb
Expand Up @@ -1404,7 +1404,7 @@ def hash(password, salt)
let(:user) { Fabricate(:user) }

it 'should publish the right message' do
message = MessageBus.track_publish { user.logged_out }.first
message = MessageBus.track_publish { user.logged_out }.find { |m| m.channel == '/logout'}

expect(message.channel).to eq('/logout')
expect(message.data).to eq(user.id)
Expand Down

4 comments on commit f60a1b0

@tgxworld
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is due to the changes we made in message_bus where a site_json would be publish.

@SamSaffron
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another nice one, missing filter so any noise can break the test, ideally noise should be impossible so this is only acceptable if the noise is "normal" eg. stuff that warms up on first run and causes more messages in a specific test

@SamSaffron
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZogStriP we use track_publish these days which is way cleaner ... I think @tgxworld moved most of the internal including this spec. I think the current behavior here is good.

@ZogStriP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I fat fingered this and clicked follow up instead of approve :(

Please sign in to comment.