尝试使用 rspec 和工厂测试一些路由。在规范测试中多次修改现有工厂的最佳方法是什么?
require "spec_helper"
describe gameController do
describe "routing" do
game = FactoryGirl.create(:game)
it "routes to #show" do
get("/game/1").should route_to("game#show", :id => "1")
end
it "routes to #show" do
# need to modify 1 param of the factory.. how best to do this?
get("/game/1").should route_to("game#show", :id => "1")
end
end
end