Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab <devaroop123@yahoo.co.in>2014-02-06 13:12:59 +0400
committerGitLab <devaroop123@yahoo.co.in>2014-02-06 13:12:59 +0400
commit1c9a41e0d5cac3ee937555ae4189ecd1ad597004 (patch)
tree5ee908eb58dc64d085426de54baacaa207feb137 /spec/models/user_spec.rb
parentb9d58c4cecd06be74c3cc32ccfb522b31544ab2e (diff)
adding tests for the ssh keys feature
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r--spec/models/user_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index f6c9f82c4ee..f7e242af00a 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -276,4 +276,16 @@ describe User do
User.by_username_or_id('bar').should be_nil
end
end
+
+ describe 'all_ssh_keys' do
+ it { should have_many(:keys).dependent(:destroy) }
+
+ it "should have all ssh keys" do
+ user = create :user
+ key = create :key, key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD33bWLBxu48Sev9Fert1yzEO4WGcWglWF7K/AwblIUFselOt/QdOL9DSjpQGxLagO1s9wl53STIO8qGS4Ms0EJZyIXOEFMjFJ5xmjSy+S37By4sG7SsltQEHMxtbtFOaW5LV2wCrX+rUsRNqLMamZjgjcPO0/EgGCXIGMAYW4O7cwGZdXWYIhQ1Vwy+CsVMDdPkPgBXqK7nR/ey8KMs8ho5fMNgB5hBw/AL9fNGhRw3QTD6Q12Nkhl4VZES2EsZqlpNnJttnPdp847DUsT6yuLRlfiQfz5Cn9ysHFdXObMN5VYIiPFwHeYCZp1X2S4fDZooRE8uOLTfxWHPXwrhqSH", user_id: user.id
+
+ user.all_ssh_keys.should include(key.key)
+ end
+
+ end
end