Functional test - changing a session variable?

i defined in the setup some session variables

def setup
@controller = RecommandationsController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
@request.session[:user] = users(:arthur) #2
@request.session[:city] = villes(:auray)
@request.session[:infos_list] =
Ouroboros.from_a(villes(:auray).infos)
end

I would like to change some of these session variables in the same test
before the posts, is it possible ?
ot should I actually write 3 tests ?

test_create
post :create, :id => ‘100’, :comment => “ok…”, :notation => ‘3’

@request.session[:user] = users(:caroline) #16
post :create, :id => ‘100’, :comment => “ok…”, :notation => ‘3’

@request.session[:user] = users(:clementine) #5
post :create, :id => ‘100’, :comment => “ok…”, :notation => ‘3’

thanks for your comments

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs