- Where Developers Learn, Share, & Build Careers


I am trying to test for cookies in my request:

  The 'spec_helper' 'description of cookies' should be set correctly '' request.cookies ['foo'] = 'bar' and end   

but it will give me the Undefined method returns 'cookies': NilClass . How do I fix it?

request object will be zero inside you test case unless you have a method < Do not request to use any of the code> get , post , delete , put , etc. .

For example, if you get root_path before request.cookies ['foo'] = 'bar' then your code works Will do

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -