gitlab-org--gitlab-foss/spec/helpers/notifications_helper_spec.rb

39 lines
1.0 KiB
Ruby
Raw Normal View History

2013-03-27 17:04:29 +00:00
require 'spec_helper'
describe NotificationsHelper do
2015-01-30 08:22:51 +00:00
include FontAwesome::Rails::IconHelper
include IconsHelper
2013-10-21 03:58:38 +00:00
describe 'notification_icon' do
2013-12-14 13:43:48 +00:00
let(:notification) { double(disabled?: false, participating?: false, watch?: false) }
2013-10-21 03:58:38 +00:00
context "disabled notification" do
before { notification.stub(disabled?: true) }
it "has a red icon" do
2014-10-01 22:21:29 +00:00
notification_icon(notification).should match('class="fa fa-volume-off ns-mute"')
2013-10-21 03:58:38 +00:00
end
end
context "participating notification" do
before { notification.stub(participating?: true) }
it "has a blue icon" do
2014-10-01 22:21:29 +00:00
notification_icon(notification).should match('class="fa fa-volume-down ns-part"')
2013-10-21 03:58:38 +00:00
end
end
context "watched notification" do
before { notification.stub(watch?: true) }
it "has a green icon" do
2014-10-01 22:21:29 +00:00
notification_icon(notification).should match('class="fa fa-volume-up ns-watch"')
2013-10-21 03:58:38 +00:00
end
end
it "has a blue icon" do
2014-10-01 22:21:29 +00:00
notification_icon(notification).should match('class="fa fa-circle-o ns-default"')
2013-10-21 03:58:38 +00:00
end
end
2013-03-27 17:04:29 +00:00
end