title: How to test cookies.permanent.signed in Rails 3
body: <p>I have a action in some controller that set some value in a permanent signed cookie like this:</p>
  
  <pre>
  <code>
  def some_action
      cookies.permanent.signed[:cookie_name] = "somevalue"
  end
  </code>
  </pre>
  
  <p>And in some functional test, I'm trying to test if the cookie was set correctly suing this:</p>
  
  <pre>
  <code>
  test "test cookies" do
      assert_equal "somevalue", cookies.permanent.signed[:cookie_name]
  end
  
  </code>
  </pre>
  
  <p>However, when I run the test, I got the following error:</p>
  
  <pre>
  <code>
  NoMethodError: undefined method `permanent' for #
  </code>
  </pre>
  
  <p>If I try only:</p>
  
  <pre>
  <code>
  test "test cookies" do
      assert_equal "somevalue", cookies.signed[:cookie_name]
  end
  
  </code>
  </pre>
  
  <p>I get: </p>
  
  <pre>
  <code>
  NoMethodError: undefined method `signed' for #
  </code>
  </pre>
  
  <p>How to test signed cookies in Rails 3?</p>