Merge branch 'fix-specs-for-access-tokens' into 'master'

Fix access token specs

See merge request !9776
This commit is contained in:
Douwe Maan 2017-03-07 19:59:23 +00:00
commit 668844f5bd
2 changed files with 3 additions and 3 deletions

View file

@ -44,7 +44,7 @@ class Admin::ImpersonationTokensController < Admin::ApplicationController
end
def set_index_vars
@scopes = Gitlab::Auth::SCOPES
@scopes = Gitlab::Auth::API_SCOPES
@impersonation_token ||= finder.build
@inactive_impersonation_tokens = finder(state: 'inactive').execute

View file

@ -15,10 +15,10 @@ describe Profiles::PersonalAccessTokensController do
name = FFaker::Product.brand
scopes = %w[api read_user]
post :create, personal_access_token: token_attributes.merge(scopes: scopes)
post :create, personal_access_token: token_attributes.merge(scopes: scopes, name: name)
expect(created_token).not_to be_nil
expect(created_token.name).to eq(token_attributes[:name])
expect(created_token.name).to eq(name)
expect(created_token.scopes).to eq(scopes)
expect(PersonalAccessToken.active).to include(created_token)
end