diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /spec/features/profiles/personal_access_tokens_spec.rb | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/features/profiles/personal_access_tokens_spec.rb')
-rw-r--r-- | spec/features/profiles/personal_access_tokens_spec.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/spec/features/profiles/personal_access_tokens_spec.rb b/spec/features/profiles/personal_access_tokens_spec.rb index 379c25d6002..de511e99182 100644 --- a/spec/features/profiles/personal_access_tokens_spec.rb +++ b/spec/features/profiles/personal_access_tokens_spec.rb @@ -42,10 +42,10 @@ RSpec.describe 'Profile > Personal Access Tokens', :js do name = 'My PAT' visit profile_personal_access_tokens_path - fill_in "Name", with: name + fill_in "Token name", with: name # Set date to 1st of next month - find_field("Expires at").click + find_field("Expiration date").click find(".pika-next").click click_on "1" @@ -66,7 +66,7 @@ RSpec.describe 'Profile > Personal Access Tokens', :js do it "displays an error message" do disallow_personal_access_token_saves! visit profile_personal_access_tokens_path - fill_in "Name", with: 'My PAT' + fill_in "Token name", with: 'My PAT' expect { click_on "Create personal access token" }.not_to change { PersonalAccessToken.count } expect(page).to have_content("Name cannot be nil") @@ -149,4 +149,15 @@ RSpec.describe 'Profile > Personal Access Tokens', :js do expect(page).to have_pushed_frontend_feature_flags(personalAccessTokensScopedToProjects: true) end + + it "prefills token details" do + name = 'My PAT' + scopes = 'api,read_user' + + visit profile_personal_access_tokens_path({ name: name, scopes: scopes }) + + expect(page).to have_field("Token name", with: name) + expect(find("#personal_access_token_scopes_api")).to be_checked + expect(find("#personal_access_token_scopes_read_user")).to be_checked + end end |