diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-03 18:53:37 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-03 18:53:37 +0100 |
commit | 829d189f44f1c8bdfc3aa60aa4ae2f477c72edad (patch) | |
tree | f3c728c3568cefd214d34635d34c5bb0a11e1d2f /spec/controllers/api/v1 | |
parent | 3731230c6d25f248afa8a17b62b3db70fdfe1e03 (diff) |
Add tests for recently added API end points
Diffstat (limited to 'spec/controllers/api/v1')
-rw-r--r-- | spec/controllers/api/v1/accounts_controller_spec.rb | 14 | ||||
-rw-r--r-- | spec/controllers/api/v1/statuses_controller_spec.rb | 26 |
2 files changed, 40 insertions, 0 deletions
diff --git a/spec/controllers/api/v1/accounts_controller_spec.rb b/spec/controllers/api/v1/accounts_controller_spec.rb index e4532305b..98eea28ce 100644 --- a/spec/controllers/api/v1/accounts_controller_spec.rb +++ b/spec/controllers/api/v1/accounts_controller_spec.rb @@ -46,6 +46,20 @@ RSpec.describe Api::V1::AccountsController, type: :controller do end end + describe 'GET #suggestions' do + it 'returns http success' do + get :suggestions + expect(response).to have_http_status(:success) + end + end + + describe 'GET #common_followers' do + it 'returns http success' do + get :common_followers, params: { id: user.account.id } + expect(response).to have_http_status(:success) + end + end + describe 'POST #follow' do let(:other_account) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob')).account } diff --git a/spec/controllers/api/v1/statuses_controller_spec.rb b/spec/controllers/api/v1/statuses_controller_spec.rb index 66060c57e..cf0b3649f 100644 --- a/spec/controllers/api/v1/statuses_controller_spec.rb +++ b/spec/controllers/api/v1/statuses_controller_spec.rb @@ -33,6 +33,32 @@ RSpec.describe Api::V1::StatusesController, type: :controller do end end + describe 'GET #reblogged_by' do + let(:status) { Fabricate(:status, account: user.account) } + + before do + post :reblog, params: { id: status.id } + end + + it 'returns http success' do + get :reblogged_by, params: { id: status.id } + expect(response).to have_http_status(:success) + end + end + + describe 'GET #favourited_by' do + let(:status) { Fabricate(:status, account: user.account) } + + before do + post :favourite, params: { id: status.id } + end + + it 'returns http success' do + get :favourited_by, params: { id: status.id } + expect(response).to have_http_status(:success) + end + end + describe 'GET #home' do it 'returns http success' do get :home |