Skip to content

Commit 2703fe3

Browse files
committed
Merge branch 'master' into issue_status_changed_notifications
2 parents 05af565 + adc71b6 commit 2703fe3

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

app/models/key.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ class Key < ActiveRecord::Base
44
belongs_to :user
55
belongs_to :project
66

7+
attr_protected :user_id
8+
79
validates :title,
810
presence: true,
911
length: { within: 0..255 }
1012

1113
validates :key,
1214
presence: true,
13-
:format => { :with => /ssh-.{3} / },
15+
format: { :with => /ssh-.{3} / },
1416
length: { within: 0..5000 }
1517

1618
before_save :set_identifier

features/profile/ssh_keys.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Feature: SSH Keys
33
Given I signin as a user
44
And I have ssh keys:
55
| title |
6-
| Work |
7-
| Home |
6+
| ssh-rsa Work |
7+
| ssh-rsa Home |
88
And I visit profile keys page
99

1010
Scenario: I should see SSH keys

features/step_definitions/profile/profile_keys_steps.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
Given /^I submit new ssh key "(.*?)"$/ do |arg1|
1818
fill_in "key_title", :with => arg1
19-
fill_in "key_key", :with => "publickey234="
19+
fill_in "key_key", :with => "ssh-rsa publickey234="
2020
click_button "Save"
2121
end
2222

spec/requests/projects_deploy_keys_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
describe "fill in" do
4343
before do
4444
fill_in "key_title", with: "laptop"
45-
fill_in "key_key", with: "publickey234="
45+
fill_in "key_key", with: "ssh-rsa publickey234="
4646
end
4747

4848
it { expect { click_button "Save" }.to change {Key.count}.by(1) }
@@ -55,12 +55,12 @@
5555
end
5656
end
5757

58-
describe "Show page" do
58+
describe "Show page" do
5959
before do
6060
@key = Factory :key, project: project
61-
visit project_deploy_key_path(project, @key)
61+
visit project_deploy_key_path(project, @key)
6262
end
63-
63+
6464
it { page.should have_content @key.title }
6565
it { page.should have_content @key.key[0..10] }
6666
end

0 commit comments

Comments
 (0)