Ich habe eine Route:Rspec Keine Route passt in Controller-Spezifikation
scope '/account' do
get '/' => 'accounts#index', as: :account
end
Und ich will es mit RSpec testen:
describe AccountsController, type: :controller do
it 'renders the index template' do
get :index
expect(response.status).to eq(200)
expect(response).to render_template :index
end
end
Aber ich habe bekam:
ActionController::UrlGenerationError: No route matches
Wie man es repariert?
Die vollständige Spur:
[11] pry(#<RSpec::ExampleGroups::AccountsController>)> get :index
ActionController::UrlGenerationError: No route matches {:action=>"index", :controller=>"accounts"}
from /home/rubydev/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.5/lib/action_dispatch/journey/formatter.rb:46:in `generate'
bitte teilen Fehler Spur verfolgen? –
@NarasimhaReddy aktualisiert – Sts
Können Sie die gesamte Testdatei zur Verfügung stellen, ich habe Ihren Code getestet und es funktioniert, welche Rails, Ruby und RSpec Version? –