Skip to content

Commit 380f6e7

Browse files
committed
change from controller::test_response to dispatch::test_response
1 parent cfd92f8 commit 380f6e7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

spec/rspec/rails/matchers/have_http_status_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
include RSpec::Rails::Matchers
55

66
def create_response(opts = {})
7-
ActionController::TestResponse.new(opts.fetch(:status))
7+
ActionDispatch::TestResponse.new(opts.fetch(:status))
88
end
99

1010
shared_examples_for "supports different response instances" do

spec/rspec/rails/matchers/have_rendered_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
%w[have_rendered render_template].each do |template_expectation|
44
describe template_expectation do
55
include RSpec::Rails::Matchers::RenderTemplate
6-
let(:response) { ActionController::TestResponse.new }
6+
let(:response) { ActionDispatch::TestResponse.new }
77

88
context "given a hash" do
99
it "delegates to assert_template" do
@@ -90,7 +90,7 @@ def assert_template(*); raise "oops"; end
9090
end
9191

9292
context "when fails with a redirect" do
93-
let(:response) { ActionController::TestResponse.new(302) }
93+
let(:response) { ActionDispatch::TestResponse.new(303) }
9494

9595
def assert_template(*)
9696
message = "expecting <'template_name'> but rendering with <[]>"
@@ -102,7 +102,7 @@ def normalize_argument_to_redirection(response_redirect_location)
102102
end
103103

104104
it "gives informative error message" do
105-
response = ActionController::TestResponse.new(302)
105+
response = ActionDispatch::TestResponse.new(302)
106106
response.location = "http://test.host/widgets/1"
107107
expect do
108108
expect(response).to send(template_expectation, "template_name")

spec/rspec/rails/matchers/redirect_to_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
describe "redirect_to" do
66
include RSpec::Rails::Matchers::RedirectTo
77

8-
let(:response) { ActionController::TestResponse.new }
8+
let(:response) { ActionDispatch::TestResponse.new }
99

1010
context "with should" do
1111
context "when assert_redirected_to passes" do

0 commit comments

Comments
 (0)