Use raw status code on have_http_status (#7214)
This commit is contained in:
parent
bfe26ef67b
commit
d10447c3a8
|
@ -17,7 +17,7 @@ RSpec.describe AboutController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ RSpec.describe AboutController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ RSpec.describe AboutController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ RSpec.describe AccountsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns correct format' do
|
it 'returns correct format' do
|
||||||
|
|
|
@ -13,7 +13,7 @@ RSpec.describe ActivityPub::OutboxesController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns application/activity+json' do
|
it 'returns application/activity+json' do
|
||||||
|
|
|
@ -63,7 +63,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index
|
get :index
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, params: { id: account.id }
|
get :show, params: { id: account.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,7 +16,7 @@ RSpec.describe Admin::ChangeEmailsController, type: :controller do
|
||||||
|
|
||||||
get :show, params: { account_id: account.id }
|
get :show, params: { account_id: account.id }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -20,14 +20,14 @@ RSpec.describe Admin::ConfirmationsController, type: :controller do
|
||||||
it 'raises an error when there is no account' do
|
it 'raises an error when there is no account' do
|
||||||
post :create, params: { account_id: 'fake' }
|
post :create, params: { account_id: 'fake' }
|
||||||
|
|
||||||
expect(response).to have_http_status(:missing)
|
expect(response).to have_http_status(404)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'raises an error when there is no user' do
|
it 'raises an error when there is no user' do
|
||||||
account = Fabricate(:account, user: nil)
|
account = Fabricate(:account, user: nil)
|
||||||
post :create, params: { account_id: account.id }
|
post :create, params: { account_id: account.id }
|
||||||
|
|
||||||
expect(response).to have_http_status(:missing)
|
expect(response).to have_http_status(404)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,7 +23,7 @@ RSpec.describe Admin::DomainBlocksController, type: :controller do
|
||||||
assigned = assigns(:domain_blocks)
|
assigned = assigns(:domain_blocks)
|
||||||
expect(assigned.count).to eq 1
|
expect(assigned.count).to eq 1
|
||||||
expect(assigned.klass).to be DomainBlock
|
expect(assigned.klass).to be DomainBlock
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ RSpec.describe Admin::DomainBlocksController, type: :controller do
|
||||||
get :new
|
get :new
|
||||||
|
|
||||||
expect(assigns(:domain_block)).to be_instance_of(DomainBlock)
|
expect(assigns(:domain_block)).to be_instance_of(DomainBlock)
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ RSpec.describe Admin::DomainBlocksController, type: :controller do
|
||||||
domain_block = Fabricate(:domain_block)
|
domain_block = Fabricate(:domain_block)
|
||||||
get :show, params: { id: domain_block.id }
|
get :show, params: { id: domain_block.id }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ RSpec.describe Admin::EmailDomainBlocksController, type: :controller do
|
||||||
assigned = assigns(:email_domain_blocks)
|
assigned = assigns(:email_domain_blocks)
|
||||||
expect(assigned.count).to eq 1
|
expect(assigned.count).to eq 1
|
||||||
expect(assigned.klass).to be EmailDomainBlock
|
expect(assigned.klass).to be EmailDomainBlock
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ RSpec.describe Admin::EmailDomainBlocksController, type: :controller do
|
||||||
get :new
|
get :new
|
||||||
|
|
||||||
expect(assigns(:email_domain_block)).to be_instance_of(EmailDomainBlock)
|
expect(assigns(:email_domain_block)).to be_instance_of(EmailDomainBlock)
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ RSpec.describe Admin::InstancesController, type: :controller do
|
||||||
expect(instances.size).to eq 1
|
expect(instances.size).to eq 1
|
||||||
expect(instances[0].domain).to eq 'less.popular'
|
expect(instances[0].domain).to eq 'less.popular'
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -84,7 +84,7 @@ describe Admin::ReportedStatusesController do
|
||||||
allow(RemovalWorker).to receive(:perform_async)
|
allow(RemovalWorker).to receive(:perform_async)
|
||||||
|
|
||||||
delete :destroy, params: { report_id: report, id: status }
|
delete :destroy, params: { report_id: report, id: status }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(RemovalWorker).
|
expect(RemovalWorker).
|
||||||
to have_received(:perform_async).with(status.id)
|
to have_received(:perform_async).with(status.id)
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,7 +18,7 @@ describe Admin::ReportsController do
|
||||||
reports = assigns(:reports).to_a
|
reports = assigns(:reports).to_a
|
||||||
expect(reports.size).to eq 1
|
expect(reports.size).to eq 1
|
||||||
expect(reports[0]).to eq specified
|
expect(reports[0]).to eq specified
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success with resolved filter' do
|
it 'returns http success with resolved filter' do
|
||||||
|
@ -31,7 +31,7 @@ describe Admin::ReportsController do
|
||||||
expect(reports.size).to eq 1
|
expect(reports.size).to eq 1
|
||||||
expect(reports[0]).to eq specified
|
expect(reports[0]).to eq specified
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ describe Admin::ReportsController do
|
||||||
get :show, params: { id: report }
|
get :show, params: { id: report }
|
||||||
|
|
||||||
expect(assigns(:report)).to eq report
|
expect(assigns(:report)).to eq report
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ describe Admin::ReportsController do
|
||||||
report = Fabricate(:report)
|
report = Fabricate(:report)
|
||||||
put :update, params: { id: report, outcome: 'unknown' }
|
put :update, params: { id: report, outcome: 'unknown' }
|
||||||
|
|
||||||
expect(response).to have_http_status(:missing)
|
expect(response).to have_http_status(404)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ RSpec.describe Admin::SettingsController, type: :controller do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :edit
|
get :edit
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ describe Admin::StatusesController do
|
||||||
|
|
||||||
statuses = assigns(:statuses).to_a
|
statuses = assigns(:statuses).to_a
|
||||||
expect(statuses.size).to eq 2
|
expect(statuses.size).to eq 2
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success with media' do
|
it 'returns http success with media' do
|
||||||
|
@ -28,7 +28,7 @@ describe Admin::StatusesController do
|
||||||
|
|
||||||
statuses = assigns(:statuses).to_a
|
statuses = assigns(:statuses).to_a
|
||||||
expect(statuses.size).to eq 1
|
expect(statuses.size).to eq 1
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ describe Admin::StatusesController do
|
||||||
allow(RemovalWorker).to receive(:perform_async)
|
allow(RemovalWorker).to receive(:perform_async)
|
||||||
|
|
||||||
delete :destroy, params: { account_id: account.id, id: status }
|
delete :destroy, params: { account_id: account.id, id: status }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(RemovalWorker).
|
expect(RemovalWorker).
|
||||||
to have_received(:perform_async).with(status.id)
|
to have_received(:perform_async).with(status.id)
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,7 +26,7 @@ RSpec.describe Admin::SubscriptionsController, type: :controller do
|
||||||
expect(subscriptions.count).to eq 1
|
expect(subscriptions.count).to eq 1
|
||||||
expect(subscriptions[0]).to eq specified
|
expect(subscriptions[0]).to eq specified
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,7 +23,7 @@ describe Api::BaseController do
|
||||||
it 'does not protect from forgery' do
|
it 'does not protect from forgery' do
|
||||||
ActionController::Base.allow_forgery_protection = true
|
ActionController::Base.allow_forgery_protection = true
|
||||||
post 'success'
|
post 'success'
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ RSpec.describe Api::OEmbedController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,7 +23,7 @@ RSpec.describe Api::PushController, type: :controller do
|
||||||
'3600',
|
'3600',
|
||||||
nil
|
nil
|
||||||
)
|
)
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(202)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ RSpec.describe Api::PushController, type: :controller do
|
||||||
account,
|
account,
|
||||||
'https://callback.host/api',
|
'https://callback.host/api',
|
||||||
)
|
)
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(202)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ RSpec.describe Api::SalmonController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(202)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'creates remote account' do
|
it 'creates remote account' do
|
||||||
|
|
|
@ -12,7 +12,7 @@ RSpec.describe Api::SubscriptionsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'echoes back the challenge' do
|
it 'echoes back the challenge' do
|
||||||
|
@ -27,7 +27,7 @@ RSpec.describe Api::SubscriptionsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:missing)
|
expect(response).to have_http_status(404)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -59,7 +59,7 @@ RSpec.describe Api::SubscriptionsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'creates statuses for feed' do
|
it 'creates statuses for feed' do
|
||||||
|
|
|
@ -14,7 +14,7 @@ describe Api::V1::Accounts::CredentialsController do
|
||||||
describe 'GET #show' do
|
describe 'GET #show' do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show
|
get :show
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ describe Api::V1::Accounts::CredentialsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'updates account info' do
|
it 'updates account info' do
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe Api::V1::Accounts::FollowerAccountsController do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index, params: { account_id: user.account.id, limit: 1 }
|
get :index, params: { account_id: user.account.id, limit: 1 }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe Api::V1::Accounts::FollowingAccountsController do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index, params: { account_id: user.account.id, limit: 1 }
|
get :index, params: { account_id: user.account.id, limit: 1 }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,7 +17,7 @@ describe Api::V1::Accounts::ListsController do
|
||||||
describe 'GET #index' do
|
describe 'GET #index' do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index, params: { account_id: account.id }
|
get :index, params: { account_id: account.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,7 +25,7 @@ describe Api::V1::Accounts::RelationshipsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns JSON with correct data' do
|
it 'returns JSON with correct data' do
|
||||||
|
@ -43,7 +43,7 @@ describe Api::V1::Accounts::RelationshipsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns JSON with correct data' do
|
it 'returns JSON with correct data' do
|
||||||
|
|
|
@ -14,7 +14,7 @@ RSpec.describe Api::V1::Accounts::SearchController, type: :controller do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, params: { q: 'query' }
|
get :show, params: { q: 'query' }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe Api::V1::Accounts::StatusesController do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index, params: { account_id: user.account.id, limit: 1 }
|
get :index, params: { account_id: user.account.id, limit: 1 }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.headers['Link'].links.size).to eq(2)
|
expect(response.headers['Link'].links.size).to eq(2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ describe Api::V1::Accounts::StatusesController do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index, params: { account_id: user.account.id, only_media: true }
|
get :index, params: { account_id: user.account.id, only_media: true }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ describe Api::V1::Accounts::StatusesController do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index, params: { account_id: user.account.id, exclude_replies: true }
|
get :index, params: { account_id: user.account.id, exclude_replies: true }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ describe Api::V1::Accounts::StatusesController do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index, params: { account_id: user.account.id, pinned: true }
|
get :index, params: { account_id: user.account.id, pinned: true }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,7 @@ RSpec.describe Api::V1::AccountsController, type: :controller do
|
||||||
describe 'GET #show' do
|
describe 'GET #show' do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, params: { id: user.account.id }
|
get :show, params: { id: user.account.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ RSpec.describe Api::V1::AccountsController, type: :controller do
|
||||||
let(:locked) { false }
|
let(:locked) { false }
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns JSON with following=true and requested=false' do
|
it 'returns JSON with following=true and requested=false' do
|
||||||
|
@ -47,7 +47,7 @@ RSpec.describe Api::V1::AccountsController, type: :controller do
|
||||||
let(:locked) { true }
|
let(:locked) { true }
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns JSON with following=false and requested=true' do
|
it 'returns JSON with following=false and requested=true' do
|
||||||
|
@ -72,7 +72,7 @@ RSpec.describe Api::V1::AccountsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'removes the following relation between user and target user' do
|
it 'removes the following relation between user and target user' do
|
||||||
|
@ -89,7 +89,7 @@ RSpec.describe Api::V1::AccountsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'removes the following relation between user and target user' do
|
it 'removes the following relation between user and target user' do
|
||||||
|
@ -110,7 +110,7 @@ RSpec.describe Api::V1::AccountsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'removes the blocking relation between user and target user' do
|
it 'removes the blocking relation between user and target user' do
|
||||||
|
@ -127,7 +127,7 @@ RSpec.describe Api::V1::AccountsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not remove the following relation between user and target user' do
|
it 'does not remove the following relation between user and target user' do
|
||||||
|
@ -152,7 +152,7 @@ RSpec.describe Api::V1::AccountsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not remove the following relation between user and target user' do
|
it 'does not remove the following relation between user and target user' do
|
||||||
|
@ -177,7 +177,7 @@ RSpec.describe Api::V1::AccountsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'removes the muting relation between user and target user' do
|
it 'removes the muting relation between user and target user' do
|
||||||
|
|
|
@ -16,7 +16,7 @@ describe Api::V1::Apps::CredentialsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not contain client credentials' do
|
it 'does not contain client credentials' do
|
||||||
|
|
|
@ -9,7 +9,7 @@ RSpec.describe Api::V1::AppsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'creates an OAuth app' do
|
it 'creates an OAuth app' do
|
||||||
|
|
|
@ -47,7 +47,7 @@ RSpec.describe Api::V1::BlocksController, type: :controller do
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index
|
get :index
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,7 +12,7 @@ RSpec.describe Api::V1::CustomEmojisController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,7 +17,7 @@ RSpec.describe Api::V1::DomainBlocksController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns blocked domains' do
|
it 'returns blocked domains' do
|
||||||
|
@ -31,7 +31,7 @@ RSpec.describe Api::V1::DomainBlocksController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'creates a domain block' do
|
it 'creates a domain block' do
|
||||||
|
@ -45,7 +45,7 @@ RSpec.describe Api::V1::DomainBlocksController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'deletes a domain block' do
|
it 'deletes a domain block' do
|
||||||
|
|
|
@ -18,7 +18,7 @@ RSpec.describe Api::V1::FollowRequestsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ RSpec.describe Api::V1::FollowRequestsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'allows follower to follow' do
|
it 'allows follower to follow' do
|
||||||
|
@ -42,7 +42,7 @@ RSpec.describe Api::V1::FollowRequestsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'removes follow request' do
|
it 'removes follow request' do
|
||||||
|
|
|
@ -24,7 +24,7 @@ RSpec.describe Api::V1::FollowsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'creates account for remote user' do
|
it 'creates account for remote user' do
|
||||||
|
@ -45,7 +45,7 @@ RSpec.describe Api::V1::FollowsController, type: :controller do
|
||||||
|
|
||||||
it 'returns http success if already following, too' do
|
it 'returns http success if already following, too' do
|
||||||
post :create, params: { uri: 'gargron@quitter.no' }
|
post :create, params: { uri: 'gargron@quitter.no' }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,7 +16,7 @@ RSpec.describe Api::V1::InstancesController, type: :controller do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show
|
get :show
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,7 +17,7 @@ describe Api::V1::Lists::AccountsController do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, params: { list_id: list.id }
|
get :show, params: { list_id: list.id }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ describe Api::V1::Lists::AccountsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'adds account to the list' do
|
it 'adds account to the list' do
|
||||||
|
@ -44,7 +44,7 @@ describe Api::V1::Lists::AccountsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'removes account from the list' do
|
it 'removes account from the list' do
|
||||||
|
|
|
@ -12,14 +12,14 @@ RSpec.describe Api::V1::ListsController, type: :controller do
|
||||||
describe 'GET #index' do
|
describe 'GET #index' do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index
|
get :index
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'GET #show' do
|
describe 'GET #show' do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, params: { id: list.id }
|
get :show, params: { id: list.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ RSpec.describe Api::V1::ListsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'creates list' do
|
it 'creates list' do
|
||||||
|
@ -44,7 +44,7 @@ RSpec.describe Api::V1::ListsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'updates the list' do
|
it 'updates the list' do
|
||||||
|
@ -58,7 +58,7 @@ RSpec.describe Api::V1::ListsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'deletes the list' do
|
it 'deletes the list' do
|
||||||
|
|
|
@ -30,7 +30,7 @@ RSpec.describe Api::V1::MediaController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http 422' do
|
it 'returns http 422' do
|
||||||
expect(response).to have_http_status(:error)
|
expect(response).to have_http_status(500)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -41,7 +41,7 @@ RSpec.describe Api::V1::MediaController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'creates a media attachment' do
|
it 'creates a media attachment' do
|
||||||
|
@ -63,7 +63,7 @@ RSpec.describe Api::V1::MediaController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'creates a media attachment' do
|
it 'creates a media attachment' do
|
||||||
|
@ -85,7 +85,7 @@ RSpec.describe Api::V1::MediaController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
xit 'returns http success' do
|
xit 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
xit 'creates a media attachment' do
|
xit 'creates a media attachment' do
|
||||||
|
|
|
@ -15,7 +15,7 @@ RSpec.describe Api::V1::MutesController, type: :controller do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index, params: { limit: 1 }
|
get :index, params: { limit: 1 }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,7 +16,7 @@ RSpec.describe Api::V1::NotificationsController, type: :controller do
|
||||||
notification = Fabricate(:notification, account: user.account)
|
notification = Fabricate(:notification, account: user.account)
|
||||||
get :show, params: { id: notification.id }
|
get :show, params: { id: notification.id }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ RSpec.describe Api::V1::NotificationsController, type: :controller do
|
||||||
notification = Fabricate(:notification, account: user.account)
|
notification = Fabricate(:notification, account: user.account)
|
||||||
post :dismiss, params: { id: notification.id }
|
post :dismiss, params: { id: notification.id }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect { notification.reload }.to raise_error(ActiveRecord::RecordNotFound)
|
expect { notification.reload }.to raise_error(ActiveRecord::RecordNotFound)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -36,7 +36,7 @@ RSpec.describe Api::V1::NotificationsController, type: :controller do
|
||||||
post :clear
|
post :clear
|
||||||
|
|
||||||
expect(notification.account.reload.notifications).to be_empty
|
expect(notification.account.reload.notifications).to be_empty
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ RSpec.describe Api::V1::NotificationsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'includes reblog' do
|
it 'includes reblog' do
|
||||||
|
@ -82,7 +82,7 @@ RSpec.describe Api::V1::NotificationsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'includes reblog' do
|
it 'includes reblog' do
|
||||||
|
|
|
@ -16,7 +16,7 @@ RSpec.describe Api::V1::ReportsController, type: :controller do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index
|
get :index
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ RSpec.describe Api::V1::ReportsController, type: :controller do
|
||||||
|
|
||||||
it 'creates a report' do
|
it 'creates a report' do
|
||||||
expect(status.reload.account.targeted_reports).not_to be_empty
|
expect(status.reload.account.targeted_reports).not_to be_empty
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'sends e-mails to admins' do
|
it 'sends e-mails to admins' do
|
||||||
|
|
|
@ -16,7 +16,7 @@ RSpec.describe Api::V1::SearchController, type: :controller do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index, params: { q: 'test' }
|
get :index, params: { q: 'test' }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,7 +21,7 @@ RSpec.describe Api::V1::Statuses::FavouritedByAccountsController, type: :control
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index, params: { status_id: status.id, limit: 1 }
|
get :index, params: { status_id: status.id, limit: 1 }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.headers['Link'].links.size).to eq(2)
|
expect(response.headers['Link'].links.size).to eq(2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -43,7 +43,7 @@ RSpec.describe Api::V1::Statuses::FavouritedByAccountsController, type: :control
|
||||||
|
|
||||||
it 'returns http unautharized' do
|
it 'returns http unautharized' do
|
||||||
get :index, params: { status_id: status.id }
|
get :index, params: { status_id: status.id }
|
||||||
expect(response).to have_http_status(:missing)
|
expect(response).to have_http_status(404)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -58,7 +58,7 @@ RSpec.describe Api::V1::Statuses::FavouritedByAccountsController, type: :control
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index, params: { status_id: status.id }
|
get :index, params: { status_id: status.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -22,7 +22,7 @@ describe Api::V1::Statuses::FavouritesController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'updates the favourites count' do
|
it 'updates the favourites count' do
|
||||||
|
@ -51,7 +51,7 @@ describe Api::V1::Statuses::FavouritesController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'updates the favourites count' do
|
it 'updates the favourites count' do
|
||||||
|
|
|
@ -22,7 +22,7 @@ describe Api::V1::Statuses::MutesController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'creates a conversation mute' do
|
it 'creates a conversation mute' do
|
||||||
|
@ -39,7 +39,7 @@ describe Api::V1::Statuses::MutesController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'destroys the conversation mute' do
|
it 'destroys the conversation mute' do
|
||||||
|
|
|
@ -22,7 +22,7 @@ describe Api::V1::Statuses::PinsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'updates the pinned attribute' do
|
it 'updates the pinned attribute' do
|
||||||
|
@ -46,7 +46,7 @@ describe Api::V1::Statuses::PinsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'updates the pinned attribute' do
|
it 'updates the pinned attribute' do
|
||||||
|
|
|
@ -21,7 +21,7 @@ RSpec.describe Api::V1::Statuses::RebloggedByAccountsController, type: :controll
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index, params: { status_id: status.id, limit: 1 }
|
get :index, params: { status_id: status.id, limit: 1 }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.headers['Link'].links.size).to eq(2)
|
expect(response.headers['Link'].links.size).to eq(2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -42,7 +42,7 @@ RSpec.describe Api::V1::Statuses::RebloggedByAccountsController, type: :controll
|
||||||
|
|
||||||
it 'returns http unautharized' do
|
it 'returns http unautharized' do
|
||||||
get :index, params: { status_id: status.id }
|
get :index, params: { status_id: status.id }
|
||||||
expect(response).to have_http_status(:missing)
|
expect(response).to have_http_status(404)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -57,7 +57,7 @@ RSpec.describe Api::V1::Statuses::RebloggedByAccountsController, type: :controll
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index, params: { status_id: status.id }
|
get :index, params: { status_id: status.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -22,7 +22,7 @@ describe Api::V1::Statuses::ReblogsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'updates the reblogs count' do
|
it 'updates the reblogs count' do
|
||||||
|
@ -51,7 +51,7 @@ describe Api::V1::Statuses::ReblogsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'updates the reblogs count' do
|
it 'updates the reblogs count' do
|
||||||
|
|
|
@ -17,7 +17,7 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, params: { id: status.id }
|
get :show, params: { id: status.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :context, params: { id: status.id }
|
get :context, params: { id: status.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'removes the status' do
|
it 'removes the status' do
|
||||||
|
@ -72,7 +72,7 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
|
||||||
describe 'GET #show' do
|
describe 'GET #show' do
|
||||||
it 'returns http unautharized' do
|
it 'returns http unautharized' do
|
||||||
get :show, params: { id: status.id }
|
get :show, params: { id: status.id }
|
||||||
expect(response).to have_http_status(:missing)
|
expect(response).to have_http_status(404)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -83,14 +83,14 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
|
||||||
|
|
||||||
it 'returns http unautharized' do
|
it 'returns http unautharized' do
|
||||||
get :context, params: { id: status.id }
|
get :context, params: { id: status.id }
|
||||||
expect(response).to have_http_status(:missing)
|
expect(response).to have_http_status(404)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'GET #card' do
|
describe 'GET #card' do
|
||||||
it 'returns http unautharized' do
|
it 'returns http unautharized' do
|
||||||
get :card, params: { id: status.id }
|
get :card, params: { id: status.id }
|
||||||
expect(response).to have_http_status(:missing)
|
expect(response).to have_http_status(404)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -101,7 +101,7 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
|
||||||
describe 'GET #show' do
|
describe 'GET #show' do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, params: { id: status.id }
|
get :show, params: { id: status.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -112,14 +112,14 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :context, params: { id: status.id }
|
get :context, params: { id: status.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'GET #card' do
|
describe 'GET #card' do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :card, params: { id: status.id }
|
get :card, params: { id: status.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,7 +23,7 @@ describe Api::V1::Timelines::HomeController do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show
|
get :show
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.headers['Link'].links.size).to eq(2)
|
expect(response.headers['Link'].links.size).to eq(2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -24,7 +24,7 @@ describe Api::V1::Timelines::ListController do
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, params: { id: list.id }
|
get :show, params: { id: list.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -22,7 +22,7 @@ describe Api::V1::Timelines::PublicController do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show
|
get :show
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.headers['Link'].links.size).to eq(2)
|
expect(response.headers['Link'].links.size).to eq(2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -35,7 +35,7 @@ describe Api::V1::Timelines::PublicController do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, params: { local: true }
|
get :show, params: { local: true }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.headers['Link'].links.size).to eq(2)
|
expect(response.headers['Link'].links.size).to eq(2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -48,7 +48,7 @@ describe Api::V1::Timelines::PublicController do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show
|
get :show
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.headers['Link']).to be_nil
|
expect(response.headers['Link']).to be_nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,7 +21,7 @@ describe Api::V1::Timelines::TagController do
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, params: { id: 'test' }
|
get :show, params: { id: 'test' }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.headers['Link'].links.size).to eq(2)
|
expect(response.headers['Link'].links.size).to eq(2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -33,7 +33,7 @@ describe Api::V1::Timelines::TagController do
|
||||||
describe 'GET #show' do
|
describe 'GET #show' do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, params: { id: 'test' }
|
get :show, params: { id: 'test' }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.headers['Link']).to be_nil
|
expect(response.headers['Link']).to be_nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,7 @@ describe Api::Web::SettingsController do
|
||||||
patch :update, format: :json, params: { data: { 'onboarded' => true } }
|
patch :update, format: :json, params: { data: { 'onboarded' => true } }
|
||||||
|
|
||||||
user.reload
|
user.reload
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(user_web_setting.data['onboarded']).to eq('true')
|
expect(user_web_setting.data['onboarded']).to eq('true')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ describe ApplicationController, type: :controller do
|
||||||
routes.draw { get 'success' => 'anonymous#success' }
|
routes.draw { get 'success' => 'anonymous#success' }
|
||||||
allow(Rails.env).to receive(:production?).and_return(false)
|
allow(Rails.env).to receive(:production?).and_return(false)
|
||||||
get 'success'
|
get 'success'
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "forces ssl if Rails.env.production? is 'true'" do
|
it "forces ssl if Rails.env.production? is 'true'" do
|
||||||
|
@ -145,13 +145,13 @@ describe ApplicationController, type: :controller do
|
||||||
|
|
||||||
it 'does nothing if not signed in' do
|
it 'does nothing if not signed in' do
|
||||||
get 'success'
|
get 'success'
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does nothing if user who signed in is not suspended' do
|
it 'does nothing if user who signed in is not suspended' do
|
||||||
sign_in(Fabricate(:user, account: Fabricate(:account, suspended: false)))
|
sign_in(Fabricate(:user, account: Fabricate(:account, suspended: false)))
|
||||||
get 'success'
|
get 'success'
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http 403 if user who signed in is suspended' do
|
it 'returns http 403 if user who signed in is suspended' do
|
||||||
|
|
|
@ -7,7 +7,7 @@ describe Auth::ConfirmationsController, type: :controller do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
@request.env['devise.mapping'] = Devise.mappings[:user]
|
@request.env['devise.mapping'] = Devise.mappings[:user]
|
||||||
get :new
|
get :new
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ describe Auth::PasswordsController, type: :controller do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
@request.env['devise.mapping'] = Devise.mappings[:user]
|
@request.env['devise.mapping'] = Devise.mappings[:user]
|
||||||
get :new
|
get :new
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ describe Auth::PasswordsController, type: :controller do
|
||||||
context 'with valid reset_password_token' do
|
context 'with valid reset_password_token' do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :edit, params: { reset_password_token: @token }
|
get :edit, params: { reset_password_token: @token }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
|
||||||
request.env["devise.mapping"] = Devise.mappings[:user]
|
request.env["devise.mapping"] = Devise.mappings[:user]
|
||||||
sign_in(Fabricate(:user))
|
sign_in(Fabricate(:user))
|
||||||
get :edit
|
get :edit
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
|
||||||
request.env["devise.mapping"] = Devise.mappings[:user]
|
request.env["devise.mapping"] = Devise.mappings[:user]
|
||||||
sign_in(Fabricate(:user), scope: :user)
|
sign_in(Fabricate(:user), scope: :user)
|
||||||
post :update
|
post :update
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
Setting.open_registrations = true
|
Setting.open_registrations = true
|
||||||
get :new
|
get :new
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ RSpec.describe Auth::SessionsController, type: :controller do
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :new
|
get :new
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ describe AuthorizeFollowsController do
|
||||||
|
|
||||||
get :show, params: { acct: 'http://example.com' }
|
get :show, params: { acct: 'http://example.com' }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(assigns(:account)).to eq account
|
expect(assigns(:account)).to eq account
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ describe AuthorizeFollowsController do
|
||||||
|
|
||||||
get :show, params: { acct: 'acct:found@hostname' }
|
get :show, params: { acct: 'acct:found@hostname' }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(assigns(:account)).to eq account
|
expect(assigns(:account)).to eq account
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -39,7 +39,7 @@ describe ApplicationController, type: :controller do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
account = Fabricate(:account)
|
account = Fabricate(:account)
|
||||||
get 'success', params: { account_username: account.username }
|
get 'success', params: { account_username: account.username }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,7 +19,7 @@ describe ApplicationController, type: :controller do
|
||||||
sign_in user
|
sign_in user
|
||||||
get :index, format: :csv
|
get :index, format: :csv
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.content_type).to eq 'text/csv'
|
expect(response.content_type).to eq 'text/csv'
|
||||||
expect(response.headers['Content-Disposition']).to eq 'attachment; filename="anonymous.csv"'
|
expect(response.headers['Content-Disposition']).to eq 'attachment; filename="anonymous.csv"'
|
||||||
expect(response.body).to eq user.account.username
|
expect(response.body).to eq user.account.username
|
||||||
|
|
|
@ -19,7 +19,7 @@ describe FollowerAccountsController do
|
||||||
expect(assigned[0]).to eq follow1
|
expect(assigned[0]).to eq follow1
|
||||||
expect(assigned[1]).to eq follow0
|
expect(assigned[1]).to eq follow0
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,7 +19,7 @@ describe FollowingAccountsController do
|
||||||
expect(assigned[0]).to eq follow1
|
expect(assigned[0]).to eq follow1
|
||||||
expect(assigned[1]).to eq follow0
|
expect(assigned[1]).to eq follow0
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ describe ManifestsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,13 +18,13 @@ describe MediaController do
|
||||||
media_attachment = Fabricate(:media_attachment, status: nil)
|
media_attachment = Fabricate(:media_attachment, status: nil)
|
||||||
get :show, params: { id: media_attachment.to_param }
|
get :show, params: { id: media_attachment.to_param }
|
||||||
|
|
||||||
expect(response).to have_http_status(:missing)
|
expect(response).to have_http_status(404)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'raises when shortcode cant be found' do
|
it 'raises when shortcode cant be found' do
|
||||||
get :show, params: { id: 'missing' }
|
get :show, params: { id: 'missing' }
|
||||||
|
|
||||||
expect(response).to have_http_status(:missing)
|
expect(response).to have_http_status(404)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'raises when not permitted to view' do
|
it 'raises when not permitted to view' do
|
||||||
|
@ -33,7 +33,7 @@ describe MediaController do
|
||||||
allow_any_instance_of(MediaController).to receive(:authorize).and_raise(ActiveRecord::RecordNotFound)
|
allow_any_instance_of(MediaController).to receive(:authorize).and_raise(ActiveRecord::RecordNotFound)
|
||||||
get :show, params: { id: media_attachment.to_param }
|
get :show, params: { id: media_attachment.to_param }
|
||||||
|
|
||||||
expect(response).to have_http_status(:missing)
|
expect(response).to have_http_status(404)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,7 +26,7 @@ RSpec.describe Oauth::AuthorizationsController, type: :controller do
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
subject
|
subject
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'gives options to authorize and deny' do
|
it 'gives options to authorize and deny' do
|
||||||
|
|
|
@ -24,7 +24,7 @@ describe Oauth::AuthorizedApplicationsController do
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
subject
|
subject
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
include_examples 'stores location for user'
|
include_examples 'stores location for user'
|
||||||
|
|
|
@ -10,7 +10,7 @@ describe RemoteFollowController do
|
||||||
account = Fabricate(:account)
|
account = Fabricate(:account)
|
||||||
get :new, params: { account_username: account.to_param }
|
get :new, params: { account_username: account.to_param }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response).to render_template(:new)
|
expect(response).to render_template(:new)
|
||||||
expect(assigns(:remote_follow).acct).to be_nil
|
expect(assigns(:remote_follow).acct).to be_nil
|
||||||
end
|
end
|
||||||
|
@ -20,7 +20,7 @@ describe RemoteFollowController do
|
||||||
account = Fabricate(:account)
|
account = Fabricate(:account)
|
||||||
get :new, params: { account_username: account.to_param }
|
get :new, params: { account_username: account.to_param }
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response).to render_template(:new)
|
expect(response).to render_template(:new)
|
||||||
expect(assigns(:remote_follow).acct).to eq 'user@example.com'
|
expect(assigns(:remote_follow).acct).to eq 'user@example.com'
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe Settings::ApplicationsController do
|
||||||
|
|
||||||
it 'shows apps' do
|
it 'shows apps' do
|
||||||
get :index
|
get :index
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(assigns(:applications)).to include(app)
|
expect(assigns(:applications)).to include(app)
|
||||||
expect(assigns(:applications)).to_not include(other_app)
|
expect(assigns(:applications)).to_not include(other_app)
|
||||||
end
|
end
|
||||||
|
@ -25,7 +25,7 @@ describe Settings::ApplicationsController do
|
||||||
describe 'GET #show' do
|
describe 'GET #show' do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, params: { id: app.id }
|
get :show, params: { id: app.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(assigns[:application]).to eql(app)
|
expect(assigns[:application]).to eql(app)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ describe Settings::ApplicationsController do
|
||||||
describe 'GET #new' do
|
describe 'GET #new' do
|
||||||
it 'works' do
|
it 'works' do
|
||||||
get :new
|
get :new
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ describe Settings::ApplicationsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'renders form again' do
|
it 'renders form again' do
|
||||||
|
@ -151,7 +151,7 @@ describe Settings::ApplicationsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'renders form again' do
|
it 'renders form again' do
|
||||||
|
|
|
@ -13,7 +13,7 @@ describe Settings::DeletesController do
|
||||||
|
|
||||||
it 'renders confirmation page' do
|
it 'renders confirmation page' do
|
||||||
get :show
|
get :show
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ describe Settings::ExportsController do
|
||||||
export = assigns(:export)
|
export = assigns(:export)
|
||||||
expect(export).to be_instance_of Export
|
expect(export).to be_instance_of Export
|
||||||
expect(export.account).to eq user.account
|
expect(export.account).to eq user.account
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ describe Settings::FollowerDomainsController do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
sign_in user, scope: :user
|
sign_in user, scope: :user
|
||||||
subject
|
subject
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
include_examples 'authenticate user'
|
include_examples 'authenticate user'
|
||||||
|
|
|
@ -10,7 +10,7 @@ RSpec.describe Settings::ImportsController, type: :controller do
|
||||||
describe "GET #show" do
|
describe "GET #show" do
|
||||||
it "returns http success" do
|
it "returns http success" do
|
||||||
get :show
|
get :show
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ describe Settings::NotificationsController do
|
||||||
describe 'GET #show' do
|
describe 'GET #show' do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show
|
get :show
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ describe Settings::PreferencesController do
|
||||||
describe 'GET #show' do
|
describe 'GET #show' do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show
|
get :show
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ RSpec.describe Settings::ProfilesController, type: :controller do
|
||||||
describe "GET #show" do
|
describe "GET #show" do
|
||||||
it "returns http success" do
|
it "returns http success" do
|
||||||
get :show
|
get :show
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe Settings::TwoFactorAuthentication::ConfirmationsController do
|
||||||
expect(assigns(:confirmation)).to be_instance_of Form::TwoFactorConfirmation
|
expect(assigns(:confirmation)).to be_instance_of Form::TwoFactorConfirmation
|
||||||
expect(assigns(:provision_url)).to eq 'otpauth://totp/local-part@domain?secret=thisisasecretforthespecofnewview&issuer=cb6e6126.ngrok.io'
|
expect(assigns(:provision_url)).to eq 'otpauth://totp/local-part@domain?secret=thisisasecretforthespecofnewview&issuer=cb6e6126.ngrok.io'
|
||||||
expect(assigns(:qrcode)).to be_instance_of RQRCode::QRCode
|
expect(assigns(:qrcode)).to be_instance_of RQRCode::QRCode
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response).to render_template(:new)
|
expect(response).to render_template(:new)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -71,7 +71,7 @@ describe Settings::TwoFactorAuthentication::ConfirmationsController do
|
||||||
|
|
||||||
expect(assigns(:recovery_codes)).to eq otp_backup_codes
|
expect(assigns(:recovery_codes)).to eq otp_backup_codes
|
||||||
expect(flash[:notice]).to eq 'Two-factor authentication successfully enabled'
|
expect(flash[:notice]).to eq 'Two-factor authentication successfully enabled'
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response).to render_template('settings/two_factor_authentication/recovery_codes/index')
|
expect(response).to render_template('settings/two_factor_authentication/recovery_codes/index')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,7 +19,7 @@ describe Settings::TwoFactorAuthentication::RecoveryCodesController do
|
||||||
|
|
||||||
expect(assigns(:recovery_codes)).to eq otp_backup_codes
|
expect(assigns(:recovery_codes)).to eq otp_backup_codes
|
||||||
expect(flash[:notice]).to eq 'Recovery codes successfully regenerated'
|
expect(flash[:notice]).to eq 'Recovery codes successfully regenerated'
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response).to render_template(:index)
|
expect(response).to render_template(:index)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ describe Settings::TwoFactorAuthenticationsController do
|
||||||
user.update(otp_required_for_login: true)
|
user.update(otp_required_for_login: true)
|
||||||
get :show
|
get :show
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ describe Settings::TwoFactorAuthenticationsController do
|
||||||
user.update(otp_required_for_login: false)
|
user.update(otp_required_for_login: false)
|
||||||
get :show
|
get :show
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -85,7 +85,7 @@ describe StatusesController do
|
||||||
it 'returns a success' do
|
it 'returns a success' do
|
||||||
status = Fabricate(:status)
|
status = Fabricate(:status)
|
||||||
get :show, params: { account_username: status.account.username, id: status.id }
|
get :show, params: { account_username: status.account.username, id: status.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'renders stream_entries/show' do
|
it 'renders stream_entries/show' do
|
||||||
|
|
|
@ -77,7 +77,7 @@ RSpec.describe StreamEntriesController, type: :controller do
|
||||||
it 'returns http success with Atom' do
|
it 'returns http success with Atom' do
|
||||||
status = Fabricate(:status)
|
status = Fabricate(:status)
|
||||||
get :show, params: { account_username: status.account.username, id: status.stream_entry.id }, format: 'atom'
|
get :show, params: { account_username: status.account.username, id: status.stream_entry.id }, format: 'atom'
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ RSpec.describe TagsController, type: :controller do
|
||||||
context 'when tag exists' do
|
context 'when tag exists' do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, params: { id: 'test', max_id: late.id }
|
get :show, params: { id: 'test', max_id: late.id }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'renders application layout' do
|
it 'renders application layout' do
|
||||||
|
@ -25,7 +25,7 @@ RSpec.describe TagsController, type: :controller do
|
||||||
it 'returns http missing for non-existent tag' do
|
it 'returns http missing for non-existent tag' do
|
||||||
get :show, params: { id: 'none' }
|
get :show, params: { id: 'none' }
|
||||||
|
|
||||||
expect(response).to have_http_status(:missing)
|
expect(response).to have_http_status(404)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ describe WellKnown::HostMetaController, type: :controller do
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :show, format: :xml
|
get :show, format: :xml
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.content_type).to eq 'application/xrd+xml'
|
expect(response.content_type).to eq 'application/xrd+xml'
|
||||||
expect(response.body).to eq <<XML
|
expect(response.body).to eq <<XML
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
|
|
|
@ -50,7 +50,7 @@ PEM
|
||||||
|
|
||||||
json = body_as_json
|
json = body_as_json
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.content_type).to eq 'application/jrd+json'
|
expect(response.content_type).to eq 'application/jrd+json'
|
||||||
expect(json[:subject]).to eq 'acct:alice@cb6e6126.ngrok.io'
|
expect(json[:subject]).to eq 'acct:alice@cb6e6126.ngrok.io'
|
||||||
expect(json[:aliases]).to include('https://cb6e6126.ngrok.io/@alice', 'https://cb6e6126.ngrok.io/users/alice')
|
expect(json[:aliases]).to include('https://cb6e6126.ngrok.io/@alice', 'https://cb6e6126.ngrok.io/users/alice')
|
||||||
|
@ -61,7 +61,7 @@ PEM
|
||||||
|
|
||||||
xml = Nokogiri::XML(response.body)
|
xml = Nokogiri::XML(response.body)
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.content_type).to eq 'application/xrd+xml'
|
expect(response.content_type).to eq 'application/xrd+xml'
|
||||||
expect(xml.at_xpath('//xmlns:Subject').content).to eq 'acct:alice@cb6e6126.ngrok.io'
|
expect(xml.at_xpath('//xmlns:Subject').content).to eq 'acct:alice@cb6e6126.ngrok.io'
|
||||||
expect(xml.xpath('//xmlns:Alias').map(&:content)).to include('https://cb6e6126.ngrok.io/@alice', 'https://cb6e6126.ngrok.io/users/alice')
|
expect(xml.xpath('//xmlns:Alias').map(&:content)).to include('https://cb6e6126.ngrok.io/@alice', 'https://cb6e6126.ngrok.io/users/alice')
|
||||||
|
@ -81,7 +81,7 @@ PEM
|
||||||
|
|
||||||
json = body_as_json
|
json = body_as_json
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.content_type).to eq 'application/jrd+json'
|
expect(response.content_type).to eq 'application/jrd+json'
|
||||||
expect(json[:subject]).to eq 'acct:alice@cb6e6126.ngrok.io'
|
expect(json[:subject]).to eq 'acct:alice@cb6e6126.ngrok.io'
|
||||||
expect(json[:aliases]).to include('https://cb6e6126.ngrok.io/@alice', 'https://cb6e6126.ngrok.io/users/alice')
|
expect(json[:aliases]).to include('https://cb6e6126.ngrok.io/@alice', 'https://cb6e6126.ngrok.io/users/alice')
|
||||||
|
|
|
@ -5,7 +5,7 @@ describe "The host_meta route" do
|
||||||
it "returns an xml response" do
|
it "returns an xml response" do
|
||||||
get host_meta_url
|
get host_meta_url
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.content_type).to eq "application/xrd+xml"
|
expect(response.content_type).to eq "application/xrd+xml"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ describe 'The webfinger route' do
|
||||||
it 'returns a json response' do
|
it 'returns a json response' do
|
||||||
get webfinger_url(resource: alice.to_webfinger_s)
|
get webfinger_url(resource: alice.to_webfinger_s)
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.content_type).to eq 'application/jrd+json'
|
expect(response.content_type).to eq 'application/jrd+json'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -16,7 +16,7 @@ describe 'The webfinger route' do
|
||||||
it 'returns an xml response for xml format' do
|
it 'returns an xml response for xml format' do
|
||||||
get webfinger_url(resource: alice.to_webfinger_s, format: :xml)
|
get webfinger_url(resource: alice.to_webfinger_s, format: :xml)
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.content_type).to eq 'application/xrd+xml'
|
expect(response.content_type).to eq 'application/xrd+xml'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ describe 'The webfinger route' do
|
||||||
headers = { 'HTTP_ACCEPT' => 'application/xrd+xml' }
|
headers = { 'HTTP_ACCEPT' => 'application/xrd+xml' }
|
||||||
get webfinger_url(resource: alice.to_webfinger_s), headers: headers
|
get webfinger_url(resource: alice.to_webfinger_s), headers: headers
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.content_type).to eq 'application/xrd+xml'
|
expect(response.content_type).to eq 'application/xrd+xml'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -33,7 +33,7 @@ describe 'The webfinger route' do
|
||||||
it 'returns a json response for json format' do
|
it 'returns a json response for json format' do
|
||||||
get webfinger_url(resource: alice.to_webfinger_s, format: :json)
|
get webfinger_url(resource: alice.to_webfinger_s, format: :json)
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.content_type).to eq 'application/jrd+json'
|
expect(response.content_type).to eq 'application/jrd+json'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ describe 'The webfinger route' do
|
||||||
headers = { 'HTTP_ACCEPT' => 'application/jrd+json' }
|
headers = { 'HTTP_ACCEPT' => 'application/jrd+json' }
|
||||||
get webfinger_url(resource: alice.to_webfinger_s), headers: headers
|
get webfinger_url(resource: alice.to_webfinger_s), headers: headers
|
||||||
|
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.content_type).to eq 'application/jrd+json'
|
expect(response.content_type).to eq 'application/jrd+json'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue