I cannot figure out how to verify that a cookie was set when testing my helper method.
Hypothetical auxiliary method:
def my_helper(k,v)
cookies[k] = v
end
Test:
it 'should set cookies' do
helper.my_helper("foo", "bar")
helper.cookies["foo"].should == "bar"
helper.response.cookies["foo"].should == "bar"
end
Does anyone know how to do this?
source
share