diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-19 12:14:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-19 12:14:10 +0300 |
commit | a87e8cad90b7d6d602cb5701d1dc588587684597 (patch) | |
tree | cd115fd058a7b982723fd7abf6d7251bfdba2ff8 /spec | |
parent | 7aa48fbe89286a7aac3638d38dac909396f7b917 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/resource_access_tokens/create_service_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/services/resource_access_tokens/create_service_spec.rb b/spec/services/resource_access_tokens/create_service_spec.rb index 218bff7ed04..5a88929334b 100644 --- a/spec/services/resource_access_tokens/create_service_spec.rb +++ b/spec/services/resource_access_tokens/create_service_spec.rb @@ -10,6 +10,10 @@ RSpec.describe ResourceAccessTokens::CreateService do let_it_be(:group) { create(:group, :private) } let_it_be(:params) { {} } + before do + stub_config_setting(host: 'example.com') + end + describe '#execute' do shared_examples 'token creation fails' do let(:resource) { create(:project)} @@ -88,6 +92,15 @@ RSpec.describe ResourceAccessTokens::CreateService do end end + context 'bot email' do + it 'check email domain' do + response = subject + access_token = response.payload[:access_token] + + expect(access_token.user.email).to end_with("@noreply.#{Gitlab.config.gitlab.host}") + end + end + context 'access level' do context 'when user does not specify an access level' do it 'adds the bot user as a maintainer in the resource' do |