Commit 7a31110b authored by Erick Banks's avatar Erick Banks Committed by Mark Lapierre

Break into two it clauses

Since this file is testing both add and remove I've broken it into
two it clauses to test both the addition and removal of the ssh
key.
parent fc115968
# frozen_string_literal: true # frozen_string_literal: true
module QA module QA
RSpec.describe 'Create' do RSpec.describe 'SSH keys support', :smoke do
describe 'SSH keys support' do key_title = "key for ssh tests #{Time.now.to_f}"
let(:key_title) { "key for ssh tests #{Time.now.to_f}" } key = nil
it 'user adds and then removes an SSH key', :smoke do before do
Flow::Login.sign_in Flow::Login.sign_in
end
key = Resource::SSHKey.fabricate_via_browser_ui! do |resource| it 'user can add an SSH key' do
resource.title = key_title key = Resource::SSHKey.fabricate_via_browser_ui! do |resource|
end resource.title = key_title
end
expect(page).to have_content(key.title) expect(page).to have_content(key.title)
expect(page).to have_content(key.md5_fingerprint) 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::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.perform(&:click_ssh_keys) Page::Profile::Menu.perform(&:click_ssh_keys)
Page::Profile::SSHKeys.perform do |ssh_keys| Page::Profile::SSHKeys.perform do |ssh_keys|
ssh_keys.remove_key(key_title) ssh_keys.remove_key(key_title)
end 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