about summary refs log tree commit diff
path: root/spec/controllers/api/v1
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2017-12-12 02:54:13 -0600
committerDavid Yip <yipdw@member.fsf.org>2017-12-12 02:54:13 -0600
commita057ed5cfea2c1c4fb21984cadae993740fb25e0 (patch)
treec965f135b8c46f679eb22e80a37550c8b985b9ea /spec/controllers/api/v1
parent04eaa1943f002865f8a0234e19c6ea4cc1d3bb6a (diff)
parent14c4a33cd9bfc1212cb362897272e5ea7d1529e5 (diff)
Merge remote-tracking branch 'tootsuite/master' into merge-upstream
Diffstat (limited to 'spec/controllers/api/v1')
-rw-r--r--spec/controllers/api/v1/accounts/lists_controller_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/controllers/api/v1/accounts/lists_controller_spec.rb b/spec/controllers/api/v1/accounts/lists_controller_spec.rb
new file mode 100644
index 000000000..0a372f65b
--- /dev/null
+++ b/spec/controllers/api/v1/accounts/lists_controller_spec.rb
@@ -0,0 +1,23 @@
+require 'rails_helper'
+
+describe Api::V1::Accounts::ListsController do
+  render_views
+
+  let(:user)    { Fabricate(:user, account: Fabricate(:account, username: 'alice')) }
+  let(:token)   { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read') }
+  let(:account) { Fabricate(:account) }
+  let(:list)    { Fabricate(:list, account: user.account) }
+
+  before do
+    allow(controller).to receive(:doorkeeper_token) { token }
+    user.account.follow!(account)
+    list.accounts << account
+  end
+
+  describe 'GET #index' do
+    it 'returns http success' do
+      get :index, params: { account_id: account.id }
+      expect(response).to have_http_status(:success)
+    end
+  end
+end