0
0
Fork 0

Use raw status code on have_http_status (#7214)

This commit is contained in:
Yamagishi Kazutoshi 2018-04-22 04:35:07 +09:00 committed by Eugen Rochko
parent bfe26ef67b
commit d10447c3a8
87 changed files with 176 additions and 176 deletions

View file

@ -63,7 +63,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
it 'returns http success' do
get :index
expect(response).to have_http_status(:success)
expect(response).to have_http_status(200)
end
end
@ -72,7 +72,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
it 'returns http success' do
get :show, params: { id: account.id }
expect(response).to have_http_status(:success)
expect(response).to have_http_status(200)
end
end
end

View file

@ -16,7 +16,7 @@ RSpec.describe Admin::ChangeEmailsController, type: :controller do
get :show, params: { account_id: account.id }
expect(response).to have_http_status(:success)
expect(response).to have_http_status(200)
end
end

View file

@ -20,14 +20,14 @@ RSpec.describe Admin::ConfirmationsController, type: :controller do
it 'raises an error when there is no account' do
post :create, params: { account_id: 'fake' }
expect(response).to have_http_status(:missing)
expect(response).to have_http_status(404)
end
it 'raises an error when there is no user' do
account = Fabricate(:account, user: nil)
post :create, params: { account_id: account.id }
expect(response).to have_http_status(:missing)
expect(response).to have_http_status(404)
end
end
end

View file

@ -23,7 +23,7 @@ RSpec.describe Admin::DomainBlocksController, type: :controller do
assigned = assigns(:domain_blocks)
expect(assigned.count).to eq 1
expect(assigned.klass).to be DomainBlock
expect(response).to have_http_status(:success)
expect(response).to have_http_status(200)
end
end
@ -32,7 +32,7 @@ RSpec.describe Admin::DomainBlocksController, type: :controller do
get :new
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
@ -41,7 +41,7 @@ RSpec.describe Admin::DomainBlocksController, type: :controller do
domain_block = Fabricate(:domain_block)
get :show, params: { id: domain_block.id }
expect(response).to have_http_status(:success)
expect(response).to have_http_status(200)
end
end

View file

@ -25,7 +25,7 @@ RSpec.describe Admin::EmailDomainBlocksController, type: :controller do
assigned = assigns(:email_domain_blocks)
expect(assigned.count).to eq 1
expect(assigned.klass).to be EmailDomainBlock
expect(response).to have_http_status(:success)
expect(response).to have_http_status(200)
end
end
@ -34,7 +34,7 @@ RSpec.describe Admin::EmailDomainBlocksController, type: :controller do
get :new
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

View file

@ -26,7 +26,7 @@ RSpec.describe Admin::InstancesController, type: :controller do
expect(instances.size).to eq 1
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

View file

@ -84,7 +84,7 @@ describe Admin::ReportedStatusesController do
allow(RemovalWorker).to receive(:perform_async)
delete :destroy, params: { report_id: report, id: status }
expect(response).to have_http_status(:success)
expect(response).to have_http_status(200)
expect(RemovalWorker).
to have_received(:perform_async).with(status.id)
end

View file

@ -18,7 +18,7 @@ describe Admin::ReportsController do
reports = assigns(:reports).to_a
expect(reports.size).to eq 1
expect(reports[0]).to eq specified
expect(response).to have_http_status(:success)
expect(response).to have_http_status(200)
end
it 'returns http success with resolved filter' do
@ -31,7 +31,7 @@ describe Admin::ReportsController do
expect(reports.size).to eq 1
expect(reports[0]).to eq specified
expect(response).to have_http_status(:success)
expect(response).to have_http_status(200)
end
end
@ -42,7 +42,7 @@ describe Admin::ReportsController do
get :show, params: { id: report }
expect(assigns(:report)).to eq report
expect(response).to have_http_status(:success)
expect(response).to have_http_status(200)
end
end
@ -52,7 +52,7 @@ describe Admin::ReportsController do
report = Fabricate(:report)
put :update, params: { id: report, outcome: 'unknown' }
expect(response).to have_http_status(:missing)
expect(response).to have_http_status(404)
end
end

View file

@ -14,7 +14,7 @@ RSpec.describe Admin::SettingsController, type: :controller do
it 'returns http success' do
get :edit
expect(response).to have_http_status(:success)
expect(response).to have_http_status(200)
end
end

View file

@ -20,7 +20,7 @@ describe Admin::StatusesController do
statuses = assigns(:statuses).to_a
expect(statuses.size).to eq 2
expect(response).to have_http_status(:success)
expect(response).to have_http_status(200)
end
it 'returns http success with media' do
@ -28,7 +28,7 @@ describe Admin::StatusesController do
statuses = assigns(:statuses).to_a
expect(statuses.size).to eq 1
expect(response).to have_http_status(:success)
expect(response).to have_http_status(200)
end
end
@ -99,7 +99,7 @@ describe Admin::StatusesController do
allow(RemovalWorker).to receive(:perform_async)
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).
to have_received(:perform_async).with(status.id)
end

View file

@ -26,7 +26,7 @@ RSpec.describe Admin::SubscriptionsController, type: :controller do
expect(subscriptions.count).to eq 1
expect(subscriptions[0]).to eq specified
expect(response).to have_http_status(:success)
expect(response).to have_http_status(200)
end
end
end