You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My websocket controller actions call current_user and user_signed_in methods and these work fine except for testing, where I have something of this sort:
let(:request_params) {{auth: {auth_token: journalist.user.authentication_token}, text: 'Test'}}
it 'triggers success when correct parameters are given' do
expect(create_event('journalist_to_executive_msg', request_params).dispatch).to trigger_success_message
end
While this works in other enviroments, the test fails with this kind of error regarding devise:
expected journalist_to_executive_msg to trigger success message, instead it triggered a failure message with data undefined method `user_signed_in?'
How can i handle this when writing tests for the websockets controller? usually in other tests you have something like:
before(:each) do
@request.env["devise.mapping"] = Devise.mappings[:user]
sign_in user
end
But that doesn't work here.
The text was updated successfully, but these errors were encountered:
My websocket controller actions call current_user and user_signed_in methods and these work fine except for testing, where I have something of this sort:
While this works in other enviroments, the test fails with this kind of error regarding devise:
How can i handle this when writing tests for the websockets controller? usually in other tests you have something like:
But that doesn't work here.
The text was updated successfully, but these errors were encountered: