From dd1ae3b10924ca239daa17ce2fe739f790e6f96d Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 12 Apr 2017 10:12:42 -0400 Subject: Simplify the way the embed view is created (#1590) * Add coverage for embedded status view * Refactor embed view to eliminate @external_links variable --- spec/controllers/stream_entries_controller_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'spec/controllers') diff --git a/spec/controllers/stream_entries_controller_spec.rb b/spec/controllers/stream_entries_controller_spec.rb index 6f270af9d..71de60604 100644 --- a/spec/controllers/stream_entries_controller_spec.rb +++ b/spec/controllers/stream_entries_controller_spec.rb @@ -17,4 +17,14 @@ RSpec.describe StreamEntriesController, type: :controller do expect(response).to have_http_status(:success) end end + + describe 'GET #embed' do + it 'returns embedded view of status' do + get :embed, params: { account_username: alice.username, id: status.stream_entry.id } + + expect(response).to have_http_status(:success) + expect(response.headers['X-Frame-Options']).to eq 'ALLOWALL' + expect(response).to render_template(layout: 'embedded') + end + end end -- cgit