spec/views/spotlight/pages/show.html.erb_spec.rb in blacklight-spotlight-3.0.3 vs spec/views/spotlight/pages/show.html.erb_spec.rb in blacklight-spotlight-3.1.0
- old
+ new
@@ -31,15 +31,25 @@
it 'injects the page title into the html title' do
expect(view).to receive(:set_html_page_title)
render
end
- it 'does not double-escape HTML entities in the HTML title' do
- allow(page).to receive_messages(title: 'Abbott & Costello')
- stub_template 'shared/_user_util_links.html.erb' => ''
- stub_template 'shared/_masthead.html.erb' => ''
- render template: 'spotlight/pages/show', layout: 'layouts/spotlight/spotlight'
- expect(rendered).to have_content('Abbott & Costello | Blacklight')
+ context 'when rendering with layout' do
+ before do
+ allow(page).to receive_messages(title: 'Abbott & Costello')
+ stub_template 'shared/_analytics.html.erb' => 'analytics'
+ stub_template 'shared/_user_util_links.html.erb' => ''
+ stub_template 'shared/_masthead.html.erb' => ''
+ render template: 'spotlight/pages/show', layout: 'layouts/spotlight/spotlight'
+ end
+
+ it 'does not double-escape HTML entities in the HTML title' do
+ expect(rendered).to have_content('Abbott & Costello | Blacklight')
+ end
+
+ it 'includes analytics reporting' do
+ expect(rendered).to have_content 'analytics'
+ end
end
it 'does not include the page title' do
allow(page).to receive_messages(should_display_title?: false)
expect(view).not_to receive(:set_html_page_title)