about summary refs log tree commit diff
path: root/spec/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/api/oembed_controller_spec.rb13
-rw-r--r--spec/controllers/api/v1/statuses_controller_spec.rb3
-rw-r--r--spec/controllers/auth/registrations_controller_spec.rb4
3 files changed, 16 insertions, 4 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 }
diff --git a/spec/controllers/auth/registrations_controller_spec.rb b/spec/controllers/auth/registrations_controller_spec.rb
index f7ebebbcb..27ad6cbde 100644
--- a/spec/controllers/auth/registrations_controller_spec.rb
+++ b/spec/controllers/auth/registrations_controller_spec.rb
@@ -20,8 +20,8 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
       post :create, params: { user: { account_attributes: { username: 'test' }, email: 'test@example.com', password: '12345678', password_confirmation: '12345678' } }
     end
 
-    it 'redirects to home page' do
-      expect(response).to redirect_to root_path
+    it 'redirects to login page' do
+      expect(response).to redirect_to new_user_session_path
     end
 
     it 'creates user' do