I feel that in this case the code will speak more than words, so put it in the code:
configurations /routes.rb
namespace :embed do
namespace :v1 do
resources :articles
end
end
application / controllers / embed / v1 / articles_controller.rb
class Embed::V1::ArticlesController < ApplicationController
def index
render :text => 'ok'
end
end
specifications / controllers / embed / v1 / articles_controller_spec.rb
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
describe Embed::V1::ArticlesController do
it "should do something" do
get :new
end
end
Launch rspec spec
$ rspec spec
F
Failures:
1) Embed::V1::ArticlesController should do something
Failure/Error: get :new
AbstractController::ActionNotFound:
The action 'new' could not be found for Embed::V1::ArticlesController
Finished in 0.01665 seconds
1 example, 1 failure
Any idea why? Is there a nested restriction? Accessing the URL http://0.0.0.0{000/embed/v1/articles displays ok as expected.
source
share