Skip to content

Commit 122937e

Browse files
committed
Extract simple view spec helper for phlex components
1 parent 8a27ceb commit 122937e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec/support/phlex_helpers.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1+
module PhlexHelpers
2+
def render_component(*, **, &)
3+
render(described_class.new(*, **, &))
4+
end
5+
end
6+
17
RSpec.configure do |config|
8+
config.include PhlexHelpers, type: :view
9+
210
config.before(:each, type: :view) do
311
allow(view).to receive(:headers).and_return({"Content-Type" => "text/html"})
412
end

0 commit comments

Comments
 (0)