From 61d108f415bc4689c52f6d0ae693568f2f25ad97 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 12 Apr 2024 05:50:46 -0400 Subject: [PATCH] Extract `header_tags` method in statuses/show view spec (#29907) --- spec/views/statuses/show.html.haml_spec.rb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/spec/views/statuses/show.html.haml_spec.rb b/spec/views/statuses/show.html.haml_spec.rb index 92ba678b6d5..c74377d985a 100644 --- a/spec/views/statuses/show.html.haml_spec.rb +++ b/spec/views/statuses/show.html.haml_spec.rb @@ -21,12 +21,11 @@ describe 'statuses/show.html.haml', :without_verify_partial_doubles do render - header_tags = view.content_for(:header_tags) - - expect(header_tags).to match(//) - expect(header_tags).to match(//) - expect(header_tags).to match(//) - expect(header_tags).to match(%r{}) + expect(header_tags) + .to match(//) + .and match(//) + .and match(//) + .and match(%r{}) end it 'has twitter player tag' do @@ -40,9 +39,12 @@ describe 'statuses/show.html.haml', :without_verify_partial_doubles do render - header_tags = view.content_for(:header_tags) + expect(header_tags) + .to match(%r{}) + .and match(//) + end - expect(header_tags).to match(%r{}) - expect(header_tags).to match(//) + def header_tags + view.content_for(:header_tags) end end