debian-mirror-gitlab/features/steps/profile/ssh_keys.rb

47 lines
1.8 KiB
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
class Spinach::Features::ProfileSshKeys < Spinach::FeatureSteps
2014-09-02 18:07:02 +05:30
include SharedAuthentication
2015-04-26 12:48:37 +05:30
step 'I should see my ssh keys' do
2014-09-02 18:07:02 +05:30
@user.keys.each do |key|
2015-09-11 14:41:01 +05:30
expect(page).to have_content(key.title)
2014-09-02 18:07:02 +05:30
end
end
2016-06-02 11:05:42 +05:30
step 'I should see new ssh key form' do
expect(page).to have_content("Add an SSH key")
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
step 'I submit new ssh key "Laptop"' do
2014-09-02 18:07:02 +05:30
fill_in "key_title", with: "Laptop"
fill_in "key_key", with: "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop"
click_button "Add key"
end
2015-04-26 12:48:37 +05:30
step 'I should see new ssh key "Laptop"' do
2014-09-02 18:07:02 +05:30
key = Key.find_by(title: "Laptop")
2015-09-11 14:41:01 +05:30
expect(page).to have_content(key.title)
expect(page).to have_content(key.key)
expect(current_path).to eq profile_key_path(key)
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
step 'I click link "Work"' do
2014-09-02 18:07:02 +05:30
click_link "Work"
end
2015-04-26 12:48:37 +05:30
step 'I click link "Remove"' do
2014-09-02 18:07:02 +05:30
click_link "Remove"
end
2015-04-26 12:48:37 +05:30
step 'I visit profile keys page' do
2014-09-02 18:07:02 +05:30
visit profile_keys_path
end
2015-04-26 12:48:37 +05:30
step 'I should not see "Work" ssh key' do
2015-09-11 14:41:01 +05:30
expect(page).not_to have_content "Work"
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
step 'I have ssh key "ssh-rsa Work"' do
2014-09-02 18:07:02 +05:30
create(:key, user: @user, title: "ssh-rsa Work", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+L3TbFegm3k8QjejSwemk4HhlRh+DuN679Pc5ckqE/MPhVtE/+kZQDYCTB284GiT2aIoGzmZ8ee9TkaoejAsBwlA+Wz2Q3vhz65X6sMgalRwpdJx8kSEUYV8ZPV3MZvPo8KdNg993o4jL6G36GDW4BPIyO6FPZhfsawdf6liVD0Xo5kibIK7B9VoE178cdLQtLpS2YolRwf5yy6XR6hbbBGQR+6xrGOdP16eGZDb1CE2bMvvJijjloFqPscGktWOqW+nfh5txwFfBzlfARDTBsS8WZtg3Yoj1kn33kPsWRlgHfNutFRAIynDuDdQzQq8tTtVwm+Yi75RfcPHW8y3P Work")
end
end