Note that there are some explanatory texts on larger screens.

plurals
  1. PORaising route not found error
    text
    copied!<p>I'm writing a book on Rails 3 at the moment and past-me has written in Chapter 3 or so that when a specific feature is run that a routing error is generated. Now, it's unlike me to go writing things that aren't true, so I'm pretty sure this happened once in the past.</p> <p>I haven't yet been able to duplicate the scenario myself, but I'm pretty confident it's one of the forgotten settings in the environment file.</p> <p>To duplicate this issue:</p> <ul> <li>Generate a new rails project</li> <li><strong>important</strong>: Remove the <code>public/index.html</code> file</li> <li>Add cucumber-rails and capybara to the "test" group in your <code>Gemfile</code></li> <li>run <code>bundle install</code></li> <li>run <code>rails g cucumber:skeleton</code></li> <li>Generate a new feature, call it <code>features/creating_projects.feature</code></li> <li>Inside this feature put:</li> </ul> <p>This:</p> <pre><code>Feature: Creating projects In order to value As a role I want feature Scenario: title Given I am on the homepage </code></pre> <p>When you run this feature using <code>bundle exec cucumber features/creating_projects.feature</code> it <em>should</em> fail with a "No route matches /" error, because you didn't define the root route. However, what I and others are seeing is that it <em>doesn't</em>.</p> <p>Now I've set a setting in <code>test.rb</code> that will get this exception page to show, but I would rather Rails did a hard-raise of the exception so that it showed up in Cucumber as a failing step, like I'm pretty sure it used to, rather than a passing step.</p> <p>Does anybody know what could have changed since May-ish of last year for Rails to not do this? I'm pretty confident it's <em>some</em> setting in <code>config/environments/test.rb</code>, but for the life of me I cannot figure it out.</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