有人知道如何让rspec遵循重定向(在控制器规范中)?(例如,测试/单元有以下重定向!)
我试过"跟踪重定向!"和"跟随你的方向",但只得到
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
但是跟着你!需要改成真正有效的东西.