rspecを(コントローラー仕様で)リダイレクトに従わせる方法を知っている人はいますか?(たとえば、テスト/ユニットにはfollow_redirectがあります!)
「follow_redirect!」を試してみました。および「follow_redirect」ですが、
undefined method `follow_redirect!' for #<Spec::Rails::Example::ControllerExampleGroup::Subclass_1:0xb6df5294>
例:
アカウントを作成すると、ページはアカウントページにリダイレクトされ、新しいアカウントがリストの一番上に表示されます。
it "should create an account" do
post :create, :name => "My New Account"
FOLLOW_REDIRECT!
response.code.should == "200"
accounts = assigns[:accounts]
accounts[0].name.should == "My New Account"
end
しかし、FOLLOW_REDIRECT!実際に機能するものに変更する必要があります。