diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /spec/features/profiles/personal_access_tokens_spec.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/features/profiles/personal_access_tokens_spec.rb')
-rw-r--r-- | spec/features/profiles/personal_access_tokens_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/features/profiles/personal_access_tokens_spec.rb b/spec/features/profiles/personal_access_tokens_spec.rb index de5a594aca6..88bfc71cfbe 100644 --- a/spec/features/profiles/personal_access_tokens_spec.rb +++ b/spec/features/profiles/personal_access_tokens_spec.rb @@ -18,6 +18,10 @@ RSpec.describe 'Profile > Personal Access Tokens', :js do find("#created-personal-access-token").value end + def feed_token + find("#feed_token").value + end + def disallow_personal_access_token_saves! allow(PersonalAccessTokens::CreateService).to receive(:new).and_return(pat_create_service) @@ -112,4 +116,26 @@ RSpec.describe 'Profile > Personal Access Tokens', :js do end end end + + describe "feed token" do + context "when enabled" do + it "displays feed token" do + allow(Gitlab::CurrentSettings).to receive(:disable_feed_token).and_return(false) + visit profile_personal_access_tokens_path + + expect(page).to have_content("Your feed token is used to authenticate you when your RSS reader loads a personalized RSS feed or when your calendar application loads a personalized calendar, and is included in those feed URLs.") + expect(feed_token).to eq(user.feed_token) + end + end + + context "when disabled" do + it "does not display feed token" do + allow(Gitlab::CurrentSettings).to receive(:disable_feed_token).and_return(true) + visit profile_personal_access_tokens_path + + expect(page).not_to have_content("Your feed token is used to authenticate you when your RSS reader loads a personalized RSS feed or when your calendar application loads a personalized calendar, and is included in those feed URLs.") + expect(page).not_to have_css("#feed_token") + end + end + end end |