diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-05-06 16:09:41 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-05-06 16:09:41 +0400 |
commit | b7f1cf9f491f6cefdfc5f651f724331f07cfd6f5 (patch) | |
tree | d54474013641957e151788795e172f6e741c0b66 /features/steps/project/deploy_keys.rb | |
parent | 42b86b79d0547d8d6f9f3fc8bc3414f7eb4a3964 (diff) |
Feature tests for deploy keys
Diffstat (limited to 'features/steps/project/deploy_keys.rb')
-rw-r--r-- | features/steps/project/deploy_keys.rb | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/features/steps/project/deploy_keys.rb b/features/steps/project/deploy_keys.rb new file mode 100644 index 00000000000..fd9dce7fe30 --- /dev/null +++ b/features/steps/project/deploy_keys.rb @@ -0,0 +1,52 @@ +class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps + include SharedAuthentication + include SharedProject + include SharedPaths + + step 'project has deploy key' do + create(:deploy_keys_project, project: @project) + end + + step 'I should see project deploy keys' do + within '.enabled-keys' do + page.should have_content deploy_key.title + end + end + + step 'I click \'New Deploy Key\'' do + click_link 'New Deploy Key' + end + + step 'I submit new deploy key' do + fill_in "deploy_key_title", with: "laptop" + fill_in "deploy_key_key", with: "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop" + click_button "Create" + end + + step 'I should be on deploy keys page' do + current_path.should == project_deploy_keys_path(@project) + end + + step 'I should see newly created deploy key' do + within '.enabled-keys' do + page.should have_content(deploy_key.title) + end + end + + step 'other project has deploy key' do + @second_project = create :project, namespace: current_user.namespace + create(:deploy_keys_project, project: @second_project) + end + + step 'I click attach deploy key' do + within '.available-keys' do + click_link 'Enable' + end + end + + protected + + def deploy_key + @project.deploy_keys.last + end +end |