diff options
author | Dominik Sander <git@dsander.de> | 2015-04-26 21:56:13 +0300 |
---|---|---|
committer | Dominik Sander <git@dsander.de> | 2015-04-26 23:00:51 +0300 |
commit | 3c3b43b0a0568950b0eb4bdfb6fd27c30686c106 (patch) | |
tree | 52fd4044d2f3995ba8ee08948c2febf8a5b70e18 /spec/models/project_services/hipchat_service_spec.rb | |
parent | f0c4c51f8323216bd90fb564d6b1bff1f247cf16 (diff) |
Add notify and color options to HipchatService
When notify is set to true send messages will trigger a notification for
all room members.
Color changes the background color of the message.
Diffstat (limited to 'spec/models/project_services/hipchat_service_spec.rb')
-rw-r--r-- | spec/models/project_services/hipchat_service_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/project_services/hipchat_service_spec.rb b/spec/models/project_services/hipchat_service_spec.rb index 8ab847e6432..348f83c56ad 100644 --- a/spec/models/project_services/hipchat_service_spec.rb +++ b/spec/models/project_services/hipchat_service_spec.rb @@ -213,5 +213,21 @@ describe HipchatService do "<pre>snippet note</pre>") end end + + context "#message_options" do + it "should be set to the defaults" do + expect(hipchat.send(:message_options)).to eq({notify: false, color: 'yellow'}) + end + + it "should set notfiy to true" do + hipchat.stub(notify: '1') + expect(hipchat.send(:message_options)).to eq({notify: true, color: 'yellow'}) + end + + it "should set the color" do + hipchat.stub(color: 'red') + expect(hipchat.send(:message_options)).to eq({notify: false, color: 'red'}) + end + end end end |