Note that there are some explanatory texts on larger screens.

plurals
  1. POrspec-rails: Failure/Error: get "/" No route matches
    text
    copied!<p>Trying out rspec-rails. I get a weird error - no routes are supposedly found, even though I can access them fine in the browser when running rails s.</p> <p>I even tried it with just /</p> <pre><code>Failure/Error: get "/" ActionController::RoutingError: No route matches {:controller=&gt;"action_view/test_case/test", :action=&gt;"/"} </code></pre> <p>I can definitely access / and other resources in the browser, though. Is there something I could've missed when setting rspec up? I put it into the Gemfile and ran rspec:install.</p> <p>Thank you, MrB</p> <p>edit: Here's my test</p> <pre><code> 1 require 'spec_helper' 2 3 describe "resource" do 4 describe "GET" do 5 it "contains /" do 6 get "/" 7 response.should have_selector("h1", :content =&gt; "Project") 8 end 9 end 10 end </code></pre> <p>Here's my route file:</p> <pre><code>myApp::Application.routes.draw do resources :groups do resources :projects end resources :projects do resources :variants resources :steps member do get 'compare' end end resources :steps do resources :costs end resources :variants do resources :costs end resources :costs root :to =&gt; "home#index" end </code></pre> <p>My spec_helper.rb:</p> <pre><code>ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} RSpec.configure do |config| config.mock_with :rspec config.include RSpec::Rails::ControllerExampleGroup config.fixture_path = "#{::Rails.root}/spec/fixtures" config.use_transactional_fixtures = true end </code></pre> <p>Didn't really change anything here, I think.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload