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
Similar to #277 but worse because I can't write any code to route around, since attempting to authenticate is the last callback that can execute. (Note in the below example this_fn_does_not_exist! truly does not exist.)
require'rails_helper'RSpec.describeMyModelsController,type: :controllerdo# ...let(:invalid_session){{}}describe"GET #show"doit"does not assign the requested my_model as @my_model"do@my_model=create(:my_model,valid_attributes)get:show,format: :json,params: {id: @my_model.id},session: invalid_sessionexpect(assigns(:my_model)).toeq(nil)endend# ...
$ rspec spec/controllers/my_models_controller.rb
F
Failures:
1) MyModelsController GET #show does not assign the requested my_model as @my_model
Failure/Error: expect(assigns(:my_model)).to eq(nil)
expected: nil
got: #<my_model id: 123, #...
The text was updated successfully, but these errors were encountered:
Similar to #277 but worse because I can't write any code to route around, since attempting to authenticate is the last callback that can execute. (Note in the below example
this_fn_does_not_exist!
truly does not exist.)The text was updated successfully, but these errors were encountered: