notifications_helper_spec.rb 987 Bytes
Newer Older
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1 2 3
require 'spec_helper'

describe NotificationsHelper do
4
  describe 'notification_icon' do
skv's avatar
skv committed
5
    let(:notification) { double(disabled?: false, participating?: false, watch?: false) }
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

    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
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
35
end