Skip to content

Commit

Permalink
Convert helper output_buffer to string
Browse files Browse the repository at this point in the history
Starting from Rails 7.1, `ActionView::TestCase#output_buffer` uses
`ActionView::OutputBuffer` rather than `ActiveSupport::SafeBuffer`.

Due to the slightly different behavior, before comparing it to a
string we we need first to convert it.

See rails/rails@532e39a
  • Loading branch information
spaghetticode authored and elia committed Dec 20, 2023
1 parent 89a9064 commit 10c237a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/spec/helpers/base_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
expect(html.css(".notice").text).to eq("ok")
expect(html.css(".foo").text).to be_empty
expect(html.css(".bar").text).to be_empty
expect(helper.output_buffer).to eq("<div class=\"flash notice\">ok</div>")
expect(helper.output_buffer.to_s).to eq("<div class=\"flash notice\">ok</div>")
end
end

Expand Down

0 comments on commit 10c237a

Please sign in to comment.