Extract shared examples from api specs (#25387)
This commit is contained in:
parent
ae2790d84f
commit
4c5f62de99
17 changed files with 23 additions and 256 deletions
|
@ -13,14 +13,6 @@ RSpec.describe Api::V1::AccountsController do
|
|||
allow(controller).to receive(:doorkeeper_token) { token }
|
||||
end
|
||||
|
||||
shared_examples 'forbidden for wrong scope' do |wrong_scope|
|
||||
let(:scopes) { wrong_scope }
|
||||
|
||||
it 'returns http forbidden' do
|
||||
expect(response).to have_http_status(403)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST #create' do
|
||||
let(:app) { Fabricate(:application) }
|
||||
let(:token) { Doorkeeper::AccessToken.find_or_create_for(application: app, resource_owner: nil, scopes: 'read write', use_refresh_token: false) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue