class GovukAbTesting::AcceptanceTests::ActiveSupport
Attributes
request_headers[R]
scope[R]
Public Class Methods
new(scope)
click to toggle source
# File lib/govuk_ab_testing/acceptance_tests/active_support.rb, line 6 def initialize(scope) @scope = scope @request_headers = {} if request.nil? raise "Couldn't find '@request' defined, are you using ActiveSupport test cases?" end end
Public Instance Methods
request()
click to toggle source
# File lib/govuk_ab_testing/acceptance_tests/active_support.rb, line 15 def request @scope.instance_variable_get(:@request) end
response()
click to toggle source
# File lib/govuk_ab_testing/acceptance_tests/active_support.rb, line 19 def response @scope.instance_variable_get(:@response) end
set_header(name, value)
click to toggle source
# File lib/govuk_ab_testing/acceptance_tests/active_support.rb, line 23 def set_header(name, value) request.headers[name] = value @request_headers[name] = value end
vary_header()
click to toggle source
# File lib/govuk_ab_testing/acceptance_tests/active_support.rb, line 28 def vary_header response.headers["Vary"] end