Commit 2703fe3e72f0084139a76c5a8332f9402cae0cf1
Exists in
master
and in
4 other branches
Merge branch 'master' into issue_status_changed_notifications
Showing
4 changed files
with
10 additions
and
8 deletions
Show diff stats
app/models/key.rb
| ... | ... | @@ -4,13 +4,15 @@ class Key < ActiveRecord::Base |
| 4 | 4 | belongs_to :user |
| 5 | 5 | belongs_to :project |
| 6 | 6 | |
| 7 | + attr_protected :user_id | |
| 8 | + | |
| 7 | 9 | validates :title, |
| 8 | 10 | presence: true, |
| 9 | 11 | length: { within: 0..255 } |
| 10 | 12 | |
| 11 | 13 | validates :key, |
| 12 | 14 | presence: true, |
| 13 | - :format => { :with => /ssh-.{3} / }, | |
| 15 | + format: { :with => /ssh-.{3} / }, | |
| 14 | 16 | length: { within: 0..5000 } |
| 15 | 17 | |
| 16 | 18 | before_save :set_identifier | ... | ... |
features/profile/ssh_keys.feature
features/step_definitions/profile/profile_keys_steps.rb
spec/requests/projects_deploy_keys_spec.rb
| ... | ... | @@ -42,7 +42,7 @@ describe "Projects", "DeployKeys" do |
| 42 | 42 | describe "fill in" do |
| 43 | 43 | before do |
| 44 | 44 | fill_in "key_title", with: "laptop" |
| 45 | - fill_in "key_key", with: "publickey234=" | |
| 45 | + fill_in "key_key", with: "ssh-rsa publickey234=" | |
| 46 | 46 | end |
| 47 | 47 | |
| 48 | 48 | it { expect { click_button "Save" }.to change {Key.count}.by(1) } |
| ... | ... | @@ -55,12 +55,12 @@ describe "Projects", "DeployKeys" do |
| 55 | 55 | end |
| 56 | 56 | end |
| 57 | 57 | |
| 58 | - describe "Show page" do | |
| 58 | + describe "Show page" do | |
| 59 | 59 | before do |
| 60 | 60 | @key = Factory :key, project: project |
| 61 | - visit project_deploy_key_path(project, @key) | |
| 61 | + visit project_deploy_key_path(project, @key) | |
| 62 | 62 | end |
| 63 | - | |
| 63 | + | |
| 64 | 64 | it { page.should have_content @key.title } |
| 65 | 65 | it { page.should have_content @key.key[0..10] } |
| 66 | 66 | end | ... | ... |