I have the following test that passes:
test "should create order" do
assert_difference('Order.count') do
post :create, { :message_text => @order.attributes }, { :var_name => 1 }
end
Instead of adding , { :var_name => 1 } to each HTTP call, how do I add the session to the setup method?
Thanks!
Inside a controller test you can access
sessionjust like you canflash.here’s a helper I use for setting the program’s id
or in the setup, you could do
then just do your test as usual
You can even assert the value of session, if the action should have changed it