使用声明式授权的“without_access_control”与 Cucumber 的@javascript



我的features/support/env.rb文件中有以下内容:

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

我在功能文件中有这个:

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

这在一个步骤文件中:

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

一切都运行良好,直到我@javascript标记该功能,然后出现错误:

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

谁能告诉我在@javascript模式下运行时如何尊重without_access_control

我认为提出相同问题的另一种方法是,当js=true时,我如何让声明式授权的内置测试助手without_access_controlrack_test一起使用?

普遍的共识似乎是这是不可能的,但如果有人证明我错了,就会更新!

相关内容

最新更新