I\'m trying to test a controller and I got this error. I understand the error, but don\'t know how to fix it.
test: on CREATE to :user with completely invali
The accepted answer doesn't work for integration tests because the @request variable doesn't exist.
According to RailsGuides, you can pass headers to the helpers.
test "blah" do
get root_path, {}, {'HTTP_REFERER' => 'http://foo.com'}
...
end
test "blah" do
get root_path, params: { id: 12 }, headers: { "HTTP_REFERER" => "http://foo.com" }
...
end