javascriptcucumbercapybararackdeclarative-authorization

Using declarative-authorization's "without_access_control"with Cucumber's @javascript


I have the following in my features/support/env.rb file:

require 'declarative_authorization/maintenance'
World(Authorization::TestHelper)

I have this in a feature file:

When I view the list of users
Then I see the list of users page

And this in a steps file:

When /^I view the list of users$/ do
  without_access_control{ visit users_path }
end

Then /^I see the list of users page$/ do
  current_path.should eq(users_path)
end

All runs fine until I tag the feature @javascript, then I get the error:

expected: "/users"
got: "/users/sign_in"

Can anyone tell me how to respect without_access_control when running in @javascript mode?

I think another way of asking the same question is how do I get Declarative Authorization's built in test-helper without_access_control to work with rack_test, when js=true?


Solution

  • General consensus seems to be this isn't possible but will update if someone proves me wrong!