Skip to content

[Rails5] Fix spec/services/applications/create_service_spec.rb

blackst0ne requested to merge blackst0ne-rails5-fix-create-service-spec into master

What does this MR do?

In Rails 5 the ActionController::TestRequest#new requires two arguments: env and session.
In Rails 4 this method required only the env argument, and session was implicitly set to ActionController::TestSession.new.

This MR explicitly adds the session argument to fix the error:

1) Applications::CreateService creates an application
    Failure/Error: let(:request) { ActionController::TestRequest.new(remote_ip: '127.0.0.1') }

    ArgumentError:
      wrong number of arguments (given 1, expected 2)
    # ./spec/services/applications/create_service_spec.rb:6:in `new'
    # ./spec/services/applications/create_service_spec.rb:6:in `block (2 levels) in <top (required)>'
    # ./spec/services/applications/create_service_spec.rb:11:in `block (3 levels) in <top (required)>'
    # ./spec/services/applications/create_service_spec.rb:11:in `block (2 levels) in <top (required)>'

Are there points in the code the reviewer needs to double check?

No.

Why was this MR needed?

Migration to Rails 5.0.

Screenshots (if relevant)

No.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

#14286 (closed) and !12841 (closed)

Merge request reports