diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-28 19:20:26 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-28 19:20:26 +0200 |
commit | 3a16acf364aa85e283ef10bbbaf6a5f558e5897e (patch) | |
tree | d1074ae9cc68f9c4cf63f95f8eacd556ae1501bc /spec | |
parent | 8f9c11af3c14c0036e7038c33262367288a09ac8 (diff) | |
parent | 89d8af466ba283b31d7800fe604defa0ce189902 (diff) | |
download | gitlab-shell-3a16acf364aa85e283ef10bbbaf6a5f558e5897e.tar.gz |
Merge pull request #177 from feedhenry/keys_list
Added list-keys command, with associated spec
Diffstat (limited to 'spec')
-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') } |