何が間違っているのかわかりませんが、リダイレクトをテストしようとするたびに、「@request must be an ActionDispatch::Request」というエラーが表示されます。
context "as non-signed in user" do
it "should redirect to the login page" do
expect { visit admin_account_url(account, host: get_host(account)) }.to redirect_to(signin_path)
end
end
1) AdminAccountPages Admin::Accounts#show as non-signed in user should redirect to the login page
Failure/Error: expect { visit admin_account_url(account, host: get_host(account)) }.to redirect_to(signin_path)
ArgumentError:
@request must be an ActionDispatch::Request
# ./spec/requests/admin_account_pages_spec.rb:16:in `block (4 levels) in <top (required)>'
Capybara (1.1.2) と Rails 3.2 で RSpec-rails (2.9.0) を使用しています。誰かがなぜこれが起こっているのか説明できれば幸いです。そのような方法で期待を使用できないのはなぜですか?