I don\'t use any gem for authentication in my app...so my sign_in method looks like this
def sign_in(user)
remember_token = User.new_remember_token
cookies[:r
The cookies hash is only available in RSpec's controller tests. You can tell your specs to pretend that they're controller specs by adding type: :request to your context, like so:
describe 'something that requires cookies', type: :request do
it { expect(cookies[:remember_token]).to be_nil } // now the variable is defined as nil.
end
That said, needing your models to know about signing in surprises me. That kind of cross-scope testing usually belongs in a feature.