I have an application using rails 3.2 and Devise. I have a test query set using rspec and Capybara.
I tried switching to using the Warden Test Assistants in my sign in the helper, instead of Capybara filling out the login form and submitting it. Due to the size and complexity of my test suite, this results in a half time savings on my test time.
In my configuration there are:
RSpec.configure do |config| config.include Warden::Test::Helpers, :type => :request config.after :each do Warden.test_reset! end end
And in the context of:
let!(:current_user) { FactoryGirl.create(:user) } background do login_as(current_user, :scope => :user) end
However, when starting a test suite using these configurations, almost every test run has a different random query response with an error due to a page that appears as if the user was not logged in. (In particular, links controlled by the conditional expression user_signed_in? ),
My question is: Has anyone else encountered such insecurity and how can it be mitigated?
Daniel Evans
source share