2013-03-27 13:04:29 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe NotificationsHelper do
|
2013-10-20 23:58:38 -04:00
|
|
|
describe 'notification_icon' do
|
2013-12-14 08:43:48 -05:00
|
|
|
let(:notification) { double(disabled?: false, participating?: false, watch?: false) }
|
2013-10-20 23:58:38 -04:00
|
|
|
|
|
|
|
context "disabled notification" do
|
2015-05-21 17:49:06 -04:00
|
|
|
before { allow(notification).to receive(:disabled?).and_return(true) }
|
2013-10-20 23:58:38 -04:00
|
|
|
|
|
|
|
it "has a red icon" do
|
2015-02-12 13:17:35 -05:00
|
|
|
expect(notification_icon(notification)).to match('class="fa fa-volume-off ns-mute"')
|
2013-10-20 23:58:38 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "participating notification" do
|
2015-05-21 17:49:06 -04:00
|
|
|
before { allow(notification).to receive(:participating?).and_return(true) }
|
2013-10-20 23:58:38 -04:00
|
|
|
|
|
|
|
it "has a blue icon" do
|
2015-02-12 13:17:35 -05:00
|
|
|
expect(notification_icon(notification)).to match('class="fa fa-volume-down ns-part"')
|
2013-10-20 23:58:38 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "watched notification" do
|
2015-05-21 17:49:06 -04:00
|
|
|
before { allow(notification).to receive(:watch?).and_return(true) }
|
2013-10-20 23:58:38 -04:00
|
|
|
|
|
|
|
it "has a green icon" do
|
2015-02-12 13:17:35 -05:00
|
|
|
expect(notification_icon(notification)).to match('class="fa fa-volume-up ns-watch"')
|
2013-10-20 23:58:38 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it "has a blue icon" do
|
2015-02-12 13:17:35 -05:00
|
|
|
expect(notification_icon(notification)).to match('class="fa fa-circle-o ns-default"')
|
2013-10-20 23:58:38 -04:00
|
|
|
end
|
|
|
|
end
|
2013-03-27 13:04:29 -04:00
|
|
|
end
|