如何发布到与测试脚本当前指向的控制器不同的控制器?在rspec测试中发布到不同的控制器
例: 在user_controller_spec.rb
it "should just post to users" do
post :create, @params # this goes to the users controller
end
我想要做的事,如:
it "should post to user and people to do some integration testing" do
post :create, @params # this goes to the users controller still
post 'people', :create, @params # this goes to the people controller
end
PS:我不想安装黄瓜
太棒了!对我来说效果很好。 – Tilo
我想检查一下它打哪个控制器,这有点帮助。 –