Hoping you can help me skip over my Declarative Authorization rules when using Cucumber. I currently have the following Cucumber feature and steps:
In feature file:
When I try to view the list of users
Then I see the users page
In steps file:
When /^I view the list of users$/ do
without_access_control{ visit users_path }
end
Then /^I see the users page$/ do
current_path.should eq(users_path)
end
It's all working correctly. However, I now need to use Javascript on the page for further testing, so I have updated the feature file to:
@javascript
When I try to view the list of users
Then I see the users page
The @javascript tag is working and firing up the browser, but am getting the error:
expected: "/users"
got: "/users/sign_in"
So when I'm running in @javascript mode, it looks as though without_access_control is being ignored. I have added the following to my env.rb file:
require 'declarative_authorization/maintenance'
World(Authorization::TestHelper)
Any ideas on how I can get the @javascript mode to respect the without_access_control?