Skip to content

Commit 33d1fac

Browse files
author
root
committed
Increment keys number
1 parent 8f4ab38 commit 33d1fac

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: spec/models/gitolite_public_key_spec.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
SSH_KEY = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDpqFJzsx3wTi3t3X/eOizU6rdtNQoqg5uSjL89F+Ojjm2/sah3ouzx+3E461FDYaoJL58Qs9eRhL+ev0BY7khYXph8nIVDzNEjhLqjevX+YhpaW9Ll7V807CwAyvMNm08aup/NrrlI/jO+At348/ivJrfO7ClcPhq4+Id9RZfvbrKaitGOURD7q6Bd7xjUjELUN8wmYxu5zvx/2n/5woVdBUMXamTPxOY5y6DxTNJ+EYzrCr+bNb7459rWUvBHUQGI2fXDGmFpGiv6ShKRhRtwob1JHI8QC9OtxonrIUesa2dW6RFneUaM7tfRfffC704Uo7yuSswb7YK+p1A9QIt5 nicolas@tchoum'
66

7+
TEST_USER = 'redmine_user7_7'
8+
79
before(:all) do
810
users = FactoryGirl.create_list(:user, 2)
911
@user1 = users[0]
@@ -37,7 +39,7 @@
3739
end
3840

3941
it "has an identifier" do
40-
expect(@ssh_key.identifier).to eq "redmine_user3_3@redmine_test_key"
42+
expect(@ssh_key.identifier).to eq "#{TEST_USER}@redmine_test_key"
4143
end
4244

4345
it "has a fingerprint" do
@@ -57,19 +59,19 @@
5759
end
5860

5961
it "has a owner" do
60-
expect(@ssh_key.owner).to eq "redmine_user3_3"
62+
expect(@ssh_key.owner).to eq "#{TEST_USER}"
6163
end
6264

6365
it "has a location" do
6466
expect(@ssh_key.location).to eq "redmine_test_key"
6567
end
6668

6769
it "has a gitolite_path" do
68-
expect(@ssh_key.gitolite_path).to eq "keydir/redmine_git_hosting/redmine_user3_3/redmine_test_key/redmine_user3_3.pub"
70+
expect(@ssh_key.gitolite_path).to eq "keydir/redmine_git_hosting/#{TEST_USER}/redmine_test_key/#{TEST_USER}.pub"
6971
end
7072

7173
it "can be rendered as yaml" do
72-
valid_hash = { :key => SSH_KEY, :location => 'redmine_test_key', :owner => 'redmine_user3_3', :title => 'redmine_user3_3@redmine_test_key' }
74+
valid_hash = { :key => SSH_KEY, :location => 'redmine_test_key', :owner => TEST_USER, :title => "#{TEST_USER}@redmine_test_key" }
7375
expect(@ssh_key.to_yaml).to eq valid_hash
7476
end
7577

0 commit comments

Comments
 (0)