debian-mirror-gitlab/spec/helpers/notifications_helper_spec.rb

39 lines
1.1 KiB
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
require 'spec_helper'
describe NotificationsHelper do
2015-04-26 12:48:37 +05:30
include FontAwesome::Rails::IconHelper
include IconsHelper
2014-09-02 18:07:02 +05:30
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
2015-04-26 12:48:37 +05:30
expect(notification_icon(notification)).to match('class="fa fa-volume-off ns-mute"')
2014-09-02 18:07:02 +05:30
end
end
context "participating notification" do
before { notification.stub(participating?: true) }
it "has a blue icon" do
2015-04-26 12:48:37 +05:30
expect(notification_icon(notification)).to match('class="fa fa-volume-down ns-part"')
2014-09-02 18:07:02 +05:30
end
end
context "watched notification" do
before { notification.stub(watch?: true) }
it "has a green icon" do
2015-04-26 12:48:37 +05:30
expect(notification_icon(notification)).to match('class="fa fa-volume-up ns-watch"')
2014-09-02 18:07:02 +05:30
end
end
it "has a blue icon" do
2015-04-26 12:48:37 +05:30
expect(notification_icon(notification)).to match('class="fa fa-circle-o ns-default"')
2014-09-02 18:07:02 +05:30
end
end
end