I'd like to call sign_in(user)
on request spec without warden callback.
Does anybody know a workaround?
I want to use something like bypass_sign_in on request spec.
I tried below.
Devise::Test::IntegrationHelpers
to my spec/rails_helper.rbconfig.include Devise::Test::IntegrationHelpers, type: :feature
RSpec.describe '/ajax/stores', type: :request do
context 'login as valid user' do
it do
sign_in(user)
end
end
end
login_as
(warden's method) but it also calls warden callbacksRSpec.describe '/ajax/stores', type: :request do
context 'login as valid user' do
it do
login_as(user, bypass: true)
end
end
end
You can pass run_callbacks: false
option to Warden's login_as
helper:
login_as(user, run_callbacks: false)