File: integration.rb

package info (click to toggle)
ruby-rails-controller-testing 1.0.5-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,016 kB
  • sloc: ruby: 646; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 535 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'action_pack'

module Rails
  module Controller
    module Testing
      module Integration
        http_verbs = %w(get post patch put head delete)

        if ActionPack.version < Gem::Version.new('5.1')
          http_verbs.push('xhr', 'xml_http_request', 'get_via_redirect', 'post_via_redirect')
        end

        http_verbs.each do |method|
          define_method(method) do |*args, **kwargs|
            reset_template_assertion
            super(*args, **kwargs)
          end
        end
      end
    end
  end
end