2014-09-02 18:07:02 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe NotificationsHelper do
|
|
|
|
describe 'notification_icon' do
|
|
|
|
let(:notification) { double(disabled?: false, participating?: false, watch?: false) }
|
|
|
|
|
|
|
|
context "disabled notification" do
|
2015-09-11 14:41:01 +05:30
|
|
|
before { allow(notification).to receive(:disabled?).and_return(true) }
|
2014-09-02 18:07:02 +05:30
|
|
|
|
|
|
|
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
|
2015-09-11 14:41:01 +05:30
|
|
|
before { allow(notification).to receive(:participating?).and_return(true) }
|
2014-09-02 18:07:02 +05:30
|
|
|
|
|
|
|
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
|
2015-09-11 14:41:01 +05:30
|
|
|
before { allow(notification).to receive(:watch?).and_return(true) }
|
2014-09-02 18:07:02 +05:30
|
|
|
|
|
|
|
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
|