summaryrefslogtreecommitdiff
path: root/spec/gitlab_keys_spec.rb
diff options
context:
space:
mode:
authorJacob Vosmaer (GitLab) <jacob@gitlab.com>2018-03-19 11:58:59 +0000
committerDouwe Maan <douwe@gitlab.com>2018-03-19 11:58:59 +0000
commitb8a5e52193b7d02de4802b589e098bbbfa0ec425 (patch)
tree30833503feb797f8610b21f2475c04e959b0ebac /spec/gitlab_keys_spec.rb
parent355e70e08b9180456ef57fb79a2c3b5654f85479 (diff)
downloadgitlab-shell-b8a5e52193b7d02de4802b589e098bbbfa0ec425.tar.gz
Switch to structured logging
Diffstat (limited to 'spec/gitlab_keys_spec.rb')
-rw-r--r--spec/gitlab_keys_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/gitlab_keys_spec.rb b/spec/gitlab_keys_spec.rb
index b9f2f87..c4e617c 100644
--- a/spec/gitlab_keys_spec.rb
+++ b/spec/gitlab_keys_spec.rb
@@ -57,7 +57,7 @@ describe GitlabKeys do
before { create_authorized_keys_fixture }
it "should log an add-key event" do
- $logger.should_receive(:info).with('Adding key key-741 => "ssh-rsa AAAAB3NzaDAxx2E"')
+ $logger.should_receive(:info).with("Adding key", {:key_id=>"key-741", :public_key=>"ssh-rsa AAAAB3NzaDAxx2E"})
gitlab_keys.send :add_key
end
@@ -127,8 +127,8 @@ describe GitlabKeys do
end
it "should log an add-key event" do
- $logger.should_receive(:info).with('Adding key key-12 => "ssh-dsa ASDFASGADG"')
- $logger.should_receive(:info).with('Adding key key-123 => "ssh-rsa GFDGDFSGSDFG"')
+ $logger.should_receive(:info).with("Adding key", key_id: 'key-12', public_key: "ssh-dsa ASDFASGADG")
+ $logger.should_receive(:info).with("Adding key", key_id: 'key-123', public_key: "ssh-rsa GFDGDFSGSDFG")
gitlab_keys.send :batch_add_keys
end
@@ -169,7 +169,7 @@ describe GitlabKeys do
end
it "should log an rm-key event" do
- $logger.should_receive(:info).with('Removing key key-741')
+ $logger.should_receive(:info).with("Removing key", key_id: "key-741")
gitlab_keys.send :rm_key
end
@@ -266,7 +266,7 @@ describe GitlabKeys do
it 'should log a warning on unknown commands' do
gitlab_keys = build_gitlab_keys('nooope')
gitlab_keys.stub(puts: nil)
- $logger.should_receive(:warn).with('Attempt to execute invalid gitlab-keys command "nooope".')
+ $logger.should_receive(:warn).with("Attempt to execute invalid gitlab-keys command", command: '"nooope"')
gitlab_keys.exec
end
end