From 29a8628c42369d3af3f94761b5264f4e9a9e1177 Mon Sep 17 00:00:00 2001 From: Cjay Billones Date: Tue, 7 Jul 2015 07:38:06 +0800 Subject: [PATCH] Refactor spec/helpers Change before(:each) into let in spec/helpers --- spec/helpers/notifications_helper_spec.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spec/helpers/notifications_helper_spec.rb b/spec/helpers/notifications_helper_spec.rb index b233246ab..5c3c7e1a2 100644 --- a/spec/helpers/notifications_helper_spec.rb +++ b/spec/helpers/notifications_helper_spec.rb @@ -3,12 +3,10 @@ require 'rails_helper' describe NotificationsHelper do describe "reply_link" do - before(:each) do - @member = FactoryGirl.create(:member) - end + let(:member) { FactoryGirl.create(:member) } it "replies to PMs with PMs" do - notification = FactoryGirl.create(:notification, :recipient_id => @member.id, :post_id => nil) + notification = FactoryGirl.create(:notification, :recipient_id => member.id, :post_id => nil) subject = "Re: " + notification.subject link = helper.reply_link(notification) @@ -17,7 +15,7 @@ describe NotificationsHelper do end it "replies to post comments with post comments" do - notification = FactoryGirl.create(:notification, :recipient_id => @member.id) + notification = FactoryGirl.create(:notification, :recipient_id => member.id) link = helper.reply_link(notification) link.should_not be_nil