about summary refs log tree commit diff
path: root/spec/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/api')
-rw-r--r--spec/controllers/api/v2/instances_controller_spec.rb22
-rw-r--r--spec/controllers/api/v2/suggestions_controller_spec.rb22
2 files changed, 44 insertions, 0 deletions
diff --git a/spec/controllers/api/v2/instances_controller_spec.rb b/spec/controllers/api/v2/instances_controller_spec.rb
new file mode 100644
index 000000000..b7206da0a
--- /dev/null
+++ b/spec/controllers/api/v2/instances_controller_spec.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe Api::V2::InstancesController do
+  render_views
+
+  let(:user)  { Fabricate(:user) }
+  let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id) }
+
+  before do
+    allow(controller).to receive(:doorkeeper_token) { token }
+  end
+
+  describe 'GET #show' do
+    it 'returns http success' do
+      get :show
+
+      expect(response).to have_http_status(200)
+    end
+  end
+end
diff --git a/spec/controllers/api/v2/suggestions_controller_spec.rb b/spec/controllers/api/v2/suggestions_controller_spec.rb
new file mode 100644
index 000000000..5e6508bfd
--- /dev/null
+++ b/spec/controllers/api/v2/suggestions_controller_spec.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe Api::V2::SuggestionsController do
+  render_views
+
+  let(:user)  { Fabricate(:user) }
+  let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read') }
+
+  before do
+    allow(controller).to receive(:doorkeeper_token) { token }
+  end
+
+  describe 'GET #index' do
+    it 'returns http success' do
+      get :index
+
+      expect(response).to have_http_status(200)
+    end
+  end
+end