title: RailsTutorial: NoMethodError 'permanent' Rake::Test::CookieJar
body: <p>app/helpers/sessions_helper.rb</p>
  
  <pre><code>module SessionsHelper
    def sign_in(user)      
      cookies.permanent[:remember_token] = user.remember_token
      self.current_user = user
    end
    def sign_out
      self.current_user = nil
      cookies.delete(:remember_token)
     end
     def signed_in?
       !current_user.nil?
     end
     def current_user=(user)
       @current_user = user
    end
    def current_user
      @current_user ||= User.find_by_remember_token(cookies[:remember_token])
    end
  end
  </code></pre>
  
  <p>Tests defined in section <code>9.2.1 Requiring signed-in users</code> are failing:-
  At first I was getting sign_in method not found then I added </p>
  
  <pre><code>include SessionsHelper
  </code></pre>
  
  <p>in spec/utilities.rb file after that I started getting below error, saying no method with name <code>permanent</code> exists in Rake::Test::CookieJar.</p>
  
  <p>Is it due to some Gem version issue. </p>
  
  <pre><code>1) User Pages edit page 
   Failure/Error: before { sign_in user}
   NoMethodError:
     undefined method `permanent' for #&lt;Rack::Test::CookieJar:0x007ff12c661e88&gt;
   # ./app/helpers/sessions_helper.rb:3:in `sign_in'
   # ./spec/requests/user_pages_spec.rb:55:in `block (3 levels) in &lt;top (required)&gt;'
  </code></pre>