summaryrefslogtreecommitdiff
path: root/spec/helpers/notifications_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab <devaroop123@yahoo.co.in>2014-02-06 19:47:21 +0530
committerGitLab <devaroop123@yahoo.co.in>2014-02-06 19:47:21 +0530
commitb1492a2a627d1fe51f5cdd5423169247a188f7e4 (patch)
treedf6956064d849616c20d2014b0a23412bdb702a5 /spec/helpers/notifications_helper_spec.rb
parent1c9a41e0d5cac3ee937555ae4189ecd1ad597004 (diff)
parent319f355aeda3fa67c1bc4451c4db5787090ab8af (diff)
downloadgitlab-ce-b1492a2a627d1fe51f5cdd5423169247a188f7e4.tar.gz
sync with upstream for ease to merge
Diffstat (limited to 'spec/helpers/notifications_helper_spec.rb')
-rw-r--r--spec/helpers/notifications_helper_spec.rb42
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..c1efc1fb2a0 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) { double(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