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
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