about summary refs log tree commit diff
path: root/spec/controllers/api
diff options
context:
space:
mode:
authorAnthony Bellew <anthonyreflected@gmail.com>2017-01-25 20:53:57 -0700
committerGitHub <noreply@github.com>2017-01-25 20:53:57 -0700
commit3d890c407356c8e0e7dd9b64e8e232ededcff8e8 (patch)
treea22df9a8737250f97a6024943af3445a163917b3 /spec/controllers/api
parentfebe2449bb14f3d877fb934ceb6d52e320712bac (diff)
parent905c82917959a5afe24cb85c62c0b0ba13f0da8b (diff)
Merge pull request #3 from tootsuite/master
Updating to current
Diffstat (limited to 'spec/controllers/api')
-rw-r--r--spec/controllers/api/oembed_controller_spec.rb13
-rw-r--r--spec/controllers/api/v1/statuses_controller_spec.rb3
2 files changed, 14 insertions, 2 deletions
diff --git a/spec/controllers/api/oembed_controller_spec.rb b/spec/controllers/api/oembed_controller_spec.rb
index 758bfd1da..511cdb463 100644
--- a/spec/controllers/api/oembed_controller_spec.rb
+++ b/spec/controllers/api/oembed_controller_spec.rb
@@ -1,5 +1,16 @@
 require 'rails_helper'
 
-RSpec.describe Api::OembedController, type: :controller do
+RSpec.describe Api::OEmbedController, type: :controller do
+  let(:alice)  { Fabricate(:account, username: 'alice') }
+  let(:status) { Fabricate(:status, text: 'Hello world', account: alice) }
 
+  describe 'GET #show' do
+    before do
+      get :show, params: { url: account_stream_entry_url(alice, status.stream_entry) }, format: :json
+    end
+
+    it 'returns http success' do
+      expect(response).to have_http_status(:success)
+    end
+  end
 end
diff --git a/spec/controllers/api/v1/statuses_controller_spec.rb b/spec/controllers/api/v1/statuses_controller_spec.rb
index d9c73f952..669956659 100644
--- a/spec/controllers/api/v1/statuses_controller_spec.rb
+++ b/spec/controllers/api/v1/statuses_controller_spec.rb
@@ -4,7 +4,8 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
   render_views
 
   let(:user)  { Fabricate(:user, account: Fabricate(:account, username: 'alice')) }
-  let(:token) { double acceptable?: true, resource_owner_id: user.id }
+  let(:app)   { Fabricate(:application, name: 'Test app', website: 'http://testapp.com') }
+  let(:token) { double acceptable?: true, resource_owner_id: user.id, application: app }
 
   before do
     allow(controller).to receive(:doorkeeper_token) { token }