Commit 7738df4e authored by Mark Lapierre's avatar Mark Lapierre

Merge branch 'egb-refactor-ssh-key-spec' into 'master'

Refactor `browser_ui/3_create/repository/add_ssh_key_spec.rb` into two `it` clauses

See merge request gitlab-org/gitlab!34428
parents 8815b77e 7a31110b
# frozen_string_literal: true
module QA
RSpec.describe 'Create' do
describe 'SSH keys support' do
let(:key_title) { "key for ssh tests #{Time.now.to_f}" }
RSpec.describe 'SSH keys support', :smoke do
key_title = "key for ssh tests #{Time.now.to_f}"
key = nil
it 'user adds and then removes an SSH key', :smoke do
Flow::Login.sign_in
before do
Flow::Login.sign_in
end
key = Resource::SSHKey.fabricate_via_browser_ui! do |resource|
resource.title = key_title
end
it 'user can add an SSH key' do
key = Resource::SSHKey.fabricate_via_browser_ui! do |resource|
resource.title = key_title
end
expect(page).to have_content(key.title)
expect(page).to have_content(key.md5_fingerprint)
expect(page).to have_content(key.title)
expect(page).to have_content(key.md5_fingerprint)
end
# Note this context ensures that the example it contains is executed after the example above. Be aware of the order of execution if you add new examples in either context.
context 'after adding an ssh key' do
it 'can delete an ssh key' do
Page::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.perform(&:click_ssh_keys)
Page::Profile::SSHKeys.perform do |ssh_keys|
ssh_keys.remove_key(key_title)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment