diff options
author | Robert Speicher <rspeicher@gmail.com> | 2013-10-20 23:58:38 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2013-10-20 23:58:38 -0400 |
commit | ae4a20133fb2917368a3f937da55da12a53a1863 (patch) | |
tree | 57ae4692c4f4db4edf5832863684a5c8a93d5fbf /spec/helpers/notifications_helper_spec.rb | |
parent | 9f7757ed24969eb004b5b81e967dff5ee4b78b1e (diff) | |
download | gitlab-ce-ae4a20133fb2917368a3f937da55da12a53a1863.tar.gz |
Add specs for NotificationsHelper
Diffstat (limited to 'spec/helpers/notifications_helper_spec.rb')
-rw-r--r-- | spec/helpers/notifications_helper_spec.rb | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/spec/helpers/notifications_helper_spec.rb b/spec/helpers/notifications_helper_spec.rb index f97959ee8f4..328f66237c3 100644 --- a/spec/helpers/notifications_helper_spec.rb +++ b/spec/helpers/notifications_helper_spec.rb @@ -1,15 +1,35 @@ require 'spec_helper' -# Specs in this file have access to a helper object that includes -# the NotificationsHelper. For example: -# -# describe NotificationsHelper do -# describe "string concat" do -# it "concats two strings with spaces" do -# helper.concat_strings("this","that").should == "this that" -# end -# end -# end describe NotificationsHelper do - pending "add some examples to (or delete) #{__FILE__}" + describe 'notification_icon' do + let(:notification) { stub(disabled?: false, participating?: false, watch?: false) } + + context "disabled notification" do + before { notification.stub(disabled?: true) } + + it "has a red icon" do + notification_icon(notification).should match('class="icon-circle cred"') + end + end + + context "participating notification" do + before { notification.stub(participating?: true) } + + it "has a blue icon" do + notification_icon(notification).should match('class="icon-circle cblue"') + end + end + + context "watched notification" do + before { notification.stub(watch?: true) } + + it "has a green icon" do + notification_icon(notification).should match('class="icon-circle cgreen"') + end + end + + it "has a blue icon" do + notification_icon(notification).should match('class="icon-circle-blank cblue"') + end + end end |