Skip to content

Commit 9e5671f

Browse files
author
Alex Egan
committed
Add yard doc and description in have_rendered.rb, add more
descriptive param name in spec
1 parent 48a663a commit 9e5671f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/rspec/rails/matchers/have_rendered.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ def matches?(*)
2121
match_check
2222
end
2323

24+
# Uses normalize_argument_to_redirection to find and format
25+
# the redirect location. normalize_argument_to_redirection is private
26+
# in ActionDispatch::Assertions::ResponseAssertions so we call it
27+
# here using #send. This will keep the error message format consistent
28+
# @api private
2429
def check_redirect
2530
response = @scope.response
2631
return unless response.respond_to?(:redirect?) && response.redirect?

spec/rspec/rails/matchers/have_rendered_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def assert_template(*)
9595
message = "expecting <'template_name'> but rendering with <[]>"
9696
raise ActiveSupport::TestCase::Assertion.new(message)
9797
end
98-
def normalize_argument_to_redirection(*)
98+
def normalize_argument_to_redirection(response_redirect_location)
9999
"http://test.host/widgets/1"
100100
end
101101
it "gives informative error message" do

0 commit comments

Comments
 (0)