diff options
author | David Martin <david.martin@feedhenry.com> | 2014-09-16 17:20:24 +0100 |
---|---|---|
committer | David Martin <david.martin@feedhenry.com> | 2014-10-15 10:21:05 +0100 |
commit | 89d8af466ba283b31d7800fe604defa0ce189902 (patch) | |
tree | fefe901225ff8b59f6d6ecc60d7ae6678456afc5 /spec/gitlab_keys_spec.rb | |
parent | 7e74d0547255a9cf60f00b9d9133aa8b2c546507 (diff) | |
download | gitlab-shell-89d8af466ba283b31d7800fe604defa0ce189902.tar.gz |
Added list-keys command and spec
Removed puts and tidied up regex
Address the hound
Address the hound, again
Use single quotes
Add back travis.yml file
Remove travis.yml, only keep on fh-master
Use single quotes
Use single quotes
Diffstat (limited to 'spec/gitlab_keys_spec.rb')
-rw-r--r-- | spec/gitlab_keys_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/gitlab_keys_spec.rb b/spec/gitlab_keys_spec.rb index aaaee15..bcce628 100644 --- a/spec/gitlab_keys_spec.rb +++ b/spec/gitlab_keys_spec.rb @@ -41,6 +41,19 @@ describe GitlabKeys do end end + describe :list_keys do + let(:gitlab_keys) do + build_gitlab_keys('add-key', 'key-741', 'ssh-rsa AAAAB3NzaDAxx2E') + end + + it 'adds a key and lists it' do + create_authorized_keys_fixture + gitlab_keys.send :add_key + auth_line1 = 'key-741 AAAAB3NzaDAxx2E' + gitlab_keys.send(:list_keys).should == "#{auth_line1}\n" + end + end + describe :batch_add_keys do let(:gitlab_keys) { build_gitlab_keys('batch-add-keys') } let(:fake_stdin) { StringIO.new("key-12\tssh-dsa ASDFASGADG\nkey-123\tssh-rsa GFDGDFSGSDFG\n", 'r') } |