diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-17 12:07:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-17 12:07:48 +0300 |
commit | 5bd24a54ef4ce3a38a860eb53b66d062c2382971 (patch) | |
tree | 5f5e65571dfcb2c62c27600ee7655dec4b44c923 /spec/models/personal_access_token_spec.rb | |
parent | 74673d04d25ffed35cbcf17cd42969bed0a4e705 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/personal_access_token_spec.rb')
-rw-r--r-- | spec/models/personal_access_token_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/personal_access_token_spec.rb b/spec/models/personal_access_token_spec.rb index aaf9ecb8089..b16d1f58be5 100644 --- a/spec/models/personal_access_token_spec.rb +++ b/spec/models/personal_access_token_spec.rb @@ -21,6 +21,18 @@ describe PersonalAccessToken do end end + describe 'scopes' do + describe '.for_user' do + it 'returns personal access tokens of specified user only' do + user_1 = create(:user) + token_of_user_1 = create(:personal_access_token, user: user_1) + create_list(:personal_access_token, 2) + + expect(described_class.for_user(user_1)).to contain_exactly(token_of_user_1) + end + end + end + describe ".active?" do let(:active_personal_access_token) { build(:personal_access_token) } let(:revoked_personal_access_token) { build(:personal_access_token, :revoked) } |