lib/rspec/rails/api/dsl/example.rb in rspec-rails-api-0.2.3 vs lib/rspec/rails/api/dsl/example.rb in rspec-rails-api-0.3.0

- old
+ new

@@ -7,11 +7,13 @@ # These methods will be available in examples (i.e.: 'for_code') module Example def visit(example, path_params: {}, payload: {}, headers: {}) # rubocop:disable Metrics/AbcSize raise 'Missing context. Call visit with for_code context.' unless example - status_code = prepare_status_code example.class.description - request_params = prepare_request_params example.class.parent.description, path_params, payload, headers + status_code = prepare_status_code example.class.description + + request_params = prepare_request_params example.class.module_parent.description, + path_params, payload, headers send(request_params[:action], request_params[:url], params: request_params[:params].to_json, headers: request_params[:headers])