Mohamad El-Husseini
2012-Jun-08 20:37 UTC
Having difficulty testing redirects with Rspec and Capybara
Every time I try to test a redirect, I get this error: @request must be an
ActionDispatch::Request
Any idea why? I''m using Rspec-Rails 2.9.0, Capybara 1.1.2, and Rails
3.2.
Here''s my test:
describe "AdminAccountPages" do
subject { page }
let(:user) { FactoryGirl.create(:user) }
let(:account) { user.owned_accounts.create!(name: "ACME Corp",
subdomain:
"acme") }
describe "Admin::Accounts#show" do
context "as non-signed in user" do
before do
visit admin_account_url(account, host: get_host(account))
end
it "should redirect to the login page" do
assert_redirected_to signin_path
end
end
end
end
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/Wxi7Un4Qq4QJ.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
