Module: Rswag::Specs::ExampleHelpers

Defined in:
lib/rswag/specs/example_helpers.rb

Instance Method Summary collapse

Instance Method Details

#assert_response_matches_metadata(metadata) ⇒ Object



30
31
32
# File 'lib/rswag/specs/example_helpers.rb', line 30

def ()
  ResponseValidator.new.validate!(, response)
end

#submit_request(metadata) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rswag/specs/example_helpers.rb', line 8

def submit_request()
  request = RequestFactory.new.build_request(, self)

  if RAILS_VERSION < 5
    send(
      request[:verb],
      request[:path],
      request[:payload],
      request[:headers]
    )
  else
    send(
      request[:verb],
      request[:path],
      {
        params: request[:payload],
        headers: request[:headers]
      }
    )
  end
end