Merge pull request #763 from CjayBillones/refactor-spec-helpers

Refactor spec/helpers
This commit is contained in:
pozorvlak
2015-07-07 11:56:52 +01:00

View File

@@ -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