mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-14 08:19:05 +00:00
Merge commit '7a70d9543525681b5c408cfd17782843da13177f' into glitch-soc/merge-upstream
This commit is contained in:
@@ -23,7 +23,7 @@ RSpec.describe ApplicationController do
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples 'respond_with_error' do |code|
|
||||
shared_examples 'error response' do |code|
|
||||
it "returns http #{code} for http and renders template" do
|
||||
subject
|
||||
|
||||
@@ -51,7 +51,7 @@ RSpec.describe ApplicationController do
|
||||
post 'success'
|
||||
end
|
||||
|
||||
include_examples 'respond_with_error', 422
|
||||
it_behaves_like 'error response', 422
|
||||
end
|
||||
|
||||
describe 'helper_method :current_account' do
|
||||
@@ -130,7 +130,7 @@ RSpec.describe ApplicationController do
|
||||
get 'routing_error'
|
||||
end
|
||||
|
||||
include_examples 'respond_with_error', 404
|
||||
it_behaves_like 'error response', 404
|
||||
end
|
||||
|
||||
context 'with ActiveRecord::RecordNotFound' do
|
||||
@@ -139,7 +139,7 @@ RSpec.describe ApplicationController do
|
||||
get 'record_not_found'
|
||||
end
|
||||
|
||||
include_examples 'respond_with_error', 404
|
||||
it_behaves_like 'error response', 404
|
||||
end
|
||||
|
||||
context 'with ActionController::InvalidAuthenticityToken' do
|
||||
@@ -148,7 +148,7 @@ RSpec.describe ApplicationController do
|
||||
get 'invalid_authenticity_token'
|
||||
end
|
||||
|
||||
include_examples 'respond_with_error', 422
|
||||
it_behaves_like 'error response', 422
|
||||
end
|
||||
|
||||
describe 'before_action :check_suspension' do
|
||||
@@ -193,7 +193,7 @@ RSpec.describe ApplicationController do
|
||||
get 'route_forbidden'
|
||||
end
|
||||
|
||||
include_examples 'respond_with_error', 403
|
||||
it_behaves_like 'error response', 403
|
||||
end
|
||||
|
||||
describe 'not_found' do
|
||||
@@ -208,7 +208,7 @@ RSpec.describe ApplicationController do
|
||||
get 'route_not_found'
|
||||
end
|
||||
|
||||
include_examples 'respond_with_error', 404
|
||||
it_behaves_like 'error response', 404
|
||||
end
|
||||
|
||||
describe 'gone' do
|
||||
@@ -223,7 +223,7 @@ RSpec.describe ApplicationController do
|
||||
get 'route_gone'
|
||||
end
|
||||
|
||||
include_examples 'respond_with_error', 410
|
||||
it_behaves_like 'error response', 410
|
||||
end
|
||||
|
||||
describe 'unprocessable_entity' do
|
||||
@@ -238,6 +238,6 @@ RSpec.describe ApplicationController do
|
||||
get 'route_unprocessable_entity'
|
||||
end
|
||||
|
||||
include_examples 'respond_with_error', 422
|
||||
it_behaves_like 'error response', 422
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user