title: rspec error with user_path(@user)
body: <p>I have this test:</p>
  
  <pre><code>require 'spec_helper'
  
  describe "LayoutLinks" do
    I18n.available_locales.each do |locale|
      I18n.locale = locale
      .
      .
  
      describe "when signed in" do
        before(:each) do
          @user = Factory(:user)
          visit signin_path
          fill_in :email,    :with =&gt; @user.email
          fill_in :password, :with =&gt; @user.password
          click_button
          visit root_path
        end
  
        .
        .
        .
        it "should have a profile link" do
          response.should have_selector('a', :href =&gt; "/#{I18n.locale}#{user_path(@user)}", :content =&gt; I18n.t(:link_profile))
        end
      end
    end
  end
  </code></pre>
  
  <p>I work with the language selection in the url. Like /en/... or /de/...</p>
  
  <p>This test gets this error Message:</p>
  
  <pre><code>No route matches {:action=&gt;"show", :controller=&gt;"users", :locale=&gt;#&lt;the complete User Hash&gt;
  </code></pre>
  
  <p>I guess from the error Message that the complete User hash is put into the locale part of the url, How is that done or how could I prevent this?</p>
  
  <p>€Edit I found the solution:</p>
  
  <p>I had to pass the locale variable to the <code>user_path(@user)</code> in this way:</p>
  
  <p><code>response.should have_selector('a', :href =&gt; user_path(I18n.locale, @user), :content =&gt; I1</code></p>