diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /spec/support/shared_examples/features/deploy_token_shared_examples.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/support/shared_examples/features/deploy_token_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/features/deploy_token_shared_examples.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/support/shared_examples/features/deploy_token_shared_examples.rb b/spec/support/shared_examples/features/deploy_token_shared_examples.rb index 25dfe089f51..79ad5bd6c7f 100644 --- a/spec/support/shared_examples/features/deploy_token_shared_examples.rb +++ b/spec/support/shared_examples/features/deploy_token_shared_examples.rb @@ -30,6 +30,27 @@ RSpec.shared_examples 'a deploy token in settings' do expect(page).to have_selector("input[name='deploy-token-user'][value='deployer']") expect(page).to have_selector("input[name='deploy-token'][readonly='readonly']") end + + expect(find("input#deploy_token_name").value).to eq nil + expect(find("input#deploy_token_read_repository").checked?).to eq false + end + + context "with form errors" do + before do + visit page_path + fill_in "deploy_token_name", with: "new_deploy_key" + fill_in "deploy_token_username", with: "deployer" + click_button "Create deploy token" + end + + it "shows form errors" do + expect(page).to have_text("Scopes can't be blank") + end + + it "keeps form inputs" do + expect(find("input#deploy_token_name").value).to eq "new_deploy_key" + expect(find("input#deploy_token_username").value).to eq "deployer" + end end context 'when User#time_display_relative is false', :js do |