开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜