mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-24 00:54:02 -05:00
24 lines
629 B
Ruby
24 lines
629 B
Ruby
# frozen_string_literal: true
|
|
|
|
shared_examples 'forbidden for wrong scope' do |wrong_scope|
|
|
let(:scopes) { wrong_scope }
|
|
|
|
it 'returns http forbidden' do
|
|
# Some examples have a subject which needs to be called to make a request
|
|
subject if request.nil?
|
|
|
|
expect(response).to have_http_status(403)
|
|
end
|
|
end
|
|
|
|
shared_examples 'forbidden for wrong role' do |wrong_role|
|
|
let(:role) { UserRole.find_by(name: wrong_role) }
|
|
|
|
it 'returns http forbidden' do
|
|
# Some examples have a subject which needs to be called to make a request
|
|
subject if request.nil?
|
|
|
|
expect(response).to have_http_status(403)
|
|
end
|
|
end
|