title: ROR 3.1 + Cucumber => Routes issue
body: <p>It would be greatly appreciated if you could assist with the following issue/act of inexperience. I have searched the usual suspects (google, stackoverflow, groups, etc) to no avail and if I have missed something blatantly obvious my apologies.</p>
  
  <p>I am starting to learn ROR3.1 plus cucumber through the following online tutorial at <a href="http://ridingrails.net/rails-3-cucumber-started-outside-in-testing/" rel="nofollow">http://ridingrails.net/rails-3-cucumber-started-outside-in-testing/</a> which seems great except for my lack of success.</p>
  
  <p>All good and well except that for some reason the one step is beyond my reach, if you could assist it would be greatly appreciated.</p>
  
  <p><strong>The Feature:</strong></p>
  
  <pre><code>Feature: User manages agents
    Scenario: User adds a new agent
      Given I go to the new agent page
      And I fill in "Name" with "Alex"
      When I press "Create"
      Then I should be on the agent list page
      And I should see "Alex"
  </code></pre>
  
  <p><strong>The Error:</strong></p>
  
  <p>Feature: User manages agents</p>
  
  <pre><code>Scenario: User adds a new agent              # features/agent_management.feature:2
  Given I go to the new agent page             # features/step_definitions/web_steps.rb:48
  And I fill in "Name" with "Alex"             # features/step_definitions/web_steps.rb:60
  When I press "Create"                        # features/step_definitions/web_steps.rb:52
  Then I should be on the agent list page      # features/step_definitions/web_steps.rb:187
    expected: "/agents"
         got: "/" (using ==) (RSpec::Expectations::ExpectationNotMetError)
    ./features/step_definitions/web_steps.rb:190:in `/^(?:|I )should be on (.+)$/'
    features/agent_management.feature:6:in `Then I should be on the agent list page'
  And I should see "Alex"          # features/step_definitions/web_steps.rb:105
  
  Failing Scenarios:
  cucumber features/agent_management.feature:2 # Scenario: User adds a new agent
  </code></pre>
  
  <p><strong>The guilty parts according to me => paths.rb:</strong></p>
  
  <pre><code>def path_to(page_name)
    case page_name
  
    when /^the home\s?page$/
      '/'
    when /the agent list page/
      agents_path
    ...
  </code></pre>
  
  <p>The web_steps.rb file is the standard one generated as described by the tutorial. Here is the function just in case:</p>
  
  <pre><code>Then /^(?:|I )should be on (.+)$/ do |page_name|
    current_path = URI.parse(current_url).path
    if current_path.respond_to? :should
      current_path.should == path_to(page_name)
    else
      assert_equal path_to(page_name), current_path
    end
  end
  </code></pre>
  
  <p><strong>Additional details</strong> that might assist:</p>
  
  <blockquote>
    <p>ruby -v => ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]</p>
    
    <p>rails -v => Rails 3.1.0.rc5</p>
    
    <p>cat /proc/version/ => Linux version 2.6.38-10-generic
    (buildd@vernadsky) (gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) )</p>
    
    <p>cat /etc/issue => Ubuntu 11.04 \n \l</p>
  </blockquote>
  
  <p>If there are any other details required please let me know as I am stumped.</p>
  
  <p>Thanking you in advance for any assistance.</p>
  
  <p><strong>EDIT</strong>
  rake routes output below:</p>
  
  <pre><code>root        /                                 {:controller=&gt;"home", :action=&gt;"index"}
  agents GET    /agents(.:format)               {:action=&gt;"index", :controller=&gt;"agents"}
  POST   /agents(.:format)                      {:action=&gt;"create", :controller=&gt;"agents"}
  new_agent GET    /agents/new(.:format)        {:action=&gt;"new", :controller=&gt;"agents"}
  edit_agent GET    /agents/:id/edit(.:format)  {:action=&gt;"edit", :controller=&gt;"agents"}
  agent GET    /agents/:id(.:format)            {:action=&gt;"show", :controller=&gt;"agents"}
  PUT    /agents/:id(.:format)                  {:action=&gt;"update", :controller=&gt;"agents"}
  DELETE /agents/:id(.:format)                  {:action=&gt;"destroy", :controller=&gt;"agents"}
  </code></pre>
  
  <p>controller:</p>
  
  <pre><code>class AgentsController &lt; ApplicationController
  
    def index
      @agents = Agent.all
    end
  
    def new
      @agent = Agent.new
    end
  
    def create
      @agent = Agent.new(params[:agent])
      if @agent.save
        redirect_to root_path
      end
    end
  
  end
  </code></pre>
  
  <p>routes:</p>
  
  <pre><code>Outsidein::Application.routes.draw do
  
    root :to =&gt; "home#index"
    resources :agents
  
  end
  </code></pre>