summaryrefslogtreecommitdiff
path: root/spec/helpers/notifications_helper_spec.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-05-21 17:49:06 -0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-22 12:13:46 +0200
commit5a9ede472150ec78f8410ae15cf782095c8f056c (patch)
tree5cbdbfb971329960011e8b3a3544e583f9551f6c /spec/helpers/notifications_helper_spec.rb
parentdad88568f34bfda5f7fe34672bc5099c80226138 (diff)
downloadgitlab-ce-5a9ede472150ec78f8410ae15cf782095c8f056c.tar.gz
Update mock and stub syntax for specs
Diffstat (limited to 'spec/helpers/notifications_helper_spec.rb')
-rw-r--r--spec/helpers/notifications_helper_spec.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/spec/helpers/notifications_helper_spec.rb b/spec/helpers/notifications_helper_spec.rb
index 482cb33e94f..f1aba4cfdf3 100644
--- a/spec/helpers/notifications_helper_spec.rb
+++ b/spec/helpers/notifications_helper_spec.rb
@@ -1,14 +1,11 @@
require 'spec_helper'
describe NotificationsHelper do
- include FontAwesome::Rails::IconHelper
- include IconsHelper
-
describe 'notification_icon' do
let(:notification) { double(disabled?: false, participating?: false, watch?: false) }
context "disabled notification" do
- before { notification.stub(disabled?: true) }
+ before { allow(notification).to receive(:disabled?).and_return(true) }
it "has a red icon" do
expect(notification_icon(notification)).to match('class="fa fa-volume-off ns-mute"')
@@ -16,7 +13,7 @@ describe NotificationsHelper do
end
context "participating notification" do
- before { notification.stub(participating?: true) }
+ before { allow(notification).to receive(:participating?).and_return(true) }
it "has a blue icon" do
expect(notification_icon(notification)).to match('class="fa fa-volume-down ns-part"')
@@ -24,7 +21,7 @@ describe NotificationsHelper do
end
context "watched notification" do
- before { notification.stub(watch?: true) }
+ before { allow(notification).to receive(:watch?).and_return(true) }
it "has a green icon" do
expect(notification_icon(notification)).to match('class="fa fa-volume-up ns-watch"')