summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorGeorge Thomas <iamgeorgethomas@gmail.com>2018-08-27 20:35:38 +0530
committerGeorge Thomas <iamgeorgethomas@gmail.com>2018-08-31 22:35:56 +0530
commit9dcbeca88955a02358b507730931e390dcfc63af (patch)
treeae98d4b39e18184eb3a34635dba52ca1c4608ce2 /spec/helpers
parent472f2d566633df6c1dee1f703b06958b9a0a2cd8 (diff)
downloadgitlab-ce-9dcbeca88955a02358b507730931e390dcfc63af.tar.gz
Hide PAT creation advice for HTTP clone if PAT exist
If the user has a active Personal Access Token, hide the help text that appears when selecting the link for HTTP clone
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/button_helper_spec.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/helpers/button_helper_spec.rb b/spec/helpers/button_helper_spec.rb
index 0c0a0003231..eebae1d7290 100644
--- a/spec/helpers/button_helper_spec.rb
+++ b/spec/helpers/button_helper_spec.rb
@@ -40,12 +40,24 @@ describe ButtonHelper do
end
context 'when user has no personal access tokens' do
- it 'has a personal access token text on the dropdown description ' do
+ it 'has a personal access token text on the dropdown description' do
description = element.search('.dropdown-menu-inner-content').first
expect(description.inner_text).to eq 'Create a personal access token on your account to pull or push via HTTP.'
end
end
+
+ context 'when user has personal access tokens' do
+ before do
+ create(:personal_access_token, user: user)
+ end
+
+ it 'does not have a personal access token text on the dropdown description' do
+ description = element.search('.dropdown-menu-inner-content').first
+
+ expect(description).to be_nil
+ end
+ end
end
context 'when user is ldap user' do