ruby on rails 3 - Testing nested namespaced controller with RSpec 2 and Rails3 -


I think the code will talk more than words in this case, so place the code:

Strong> app /controllers/embed/v1/articles_controller.rb

  class embed :: V1 :: article controller & lt; ApplicationController def index render: text = & gt; 'OK' End End   

Tip / Controller / Embed / v1 / articles_controller_spec.rb

  file. Expand_path (requires the file .dirname (__ FILE__) + '/../../../spec_helper') embed: V1 :: article controllers do "do something" should get: new End end   

Running rspec spec

  $ rspec spec F failures: 1) Embed: : V1 :: Article Controller Should Do Something Error / Error: Receive: New Abrid Controller :: Action Notfound: Amended :: Action :: News Controller # ./spec/controllers/embed/v1/articles_controller_spec.rbitter For 'New ' No Can be lit ends in 0.01665 seconds Example 1, 1 failure   

Why is there any idea? What is the nested limit? The URL reaches exactly as OK from http://0.0.0.0:3000/embed/v1/articles .

You have new verb embed :: V1 :: ArticlesController Not defined in , only by trying to kill new action in your spec with the index action you get : new Are there.

Comments