about summary refs log tree commit diff
path: root/spec/controllers
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-04-12 10:12:42 -0400
committerEugen <eugen@zeonfederated.com>2017-04-12 16:12:42 +0200
commitdd1ae3b10924ca239daa17ce2fe739f790e6f96d (patch)
tree28f3b8ee56bde264236fb3e01c059f1dc7bfa0a5 /spec/controllers
parentb352a8e5d4f3dba4b923a2a21dc9ae5343e7e8e4 (diff)
Simplify the way the embed view is created (#1590)
* Add coverage for embedded status view

* Refactor embed view to eliminate @external_links variable
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/stream_entries_controller_spec.rb10
1 files changed, 10 insertions, 0 deletions
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