How to get RSpec to call a singular route when testing controller?
Anyone know how to get RSpec to call a singular route when testing controller?
It can't find the route b/c it doesn't know to look for a singular controller so I need a way to specify it.
routes.rb
resource :settings_group, :path => "/settings/scheduling/"
settings_groups_开发者_Go百科controller_spec.rb
describe SettingsGroupsController do
describe "GET show" do
let(:describe_action) { get :show }
it "sets @settings_group" do
describe_action
assigns(:settings_group).should be_kind_of(SettingsGroup)
end
end
end
...
ActionController::RoutingError:
No route matches {:controller=>"settings_groups"}
Just out of curiosity, but why does settings_group_controller.rb have
describe SettingsGroupsController (with an s)
Shouldn't they match?
精彩评论