From fe6c058f9a655b5378bb5a3758e1eb687cbbad4c Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Tue, 27 Jan 2015 20:04:16 -0200 Subject: [PATCH] Remove dead code --- app/helpers/person_notifier_helper.rb | 15 --------------- app/models/person_notifier.rb | 2 +- test/unit/person_notifier_helper_test.rb | 23 ----------------------- 3 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 app/helpers/person_notifier_helper.rb delete mode 100644 test/unit/person_notifier_helper_test.rb diff --git a/app/helpers/person_notifier_helper.rb b/app/helpers/person_notifier_helper.rb deleted file mode 100644 index 65b084c..0000000 --- a/app/helpers/person_notifier_helper.rb +++ /dev/null @@ -1,15 +0,0 @@ -module PersonNotifierHelper - - include ApplicationHelper - - private - - def path_to_image(source) - top_url + source - end - - def top_url - top_url = @profile.environment ? @profile.environment.top_url : '' - end - -end diff --git a/app/models/person_notifier.rb b/app/models/person_notifier.rb index 5e8febf..84e9fd6 100644 --- a/app/models/person_notifier.rb +++ b/app/models/person_notifier.rb @@ -67,7 +67,7 @@ class PersonNotifier class Mailer < ActionMailer::Base - add_template_helper(PersonNotifierHelper) + add_template_helper(ApplicationHelper) def session {:theme => nil} diff --git a/test/unit/person_notifier_helper_test.rb b/test/unit/person_notifier_helper_test.rb deleted file mode 100644 index 9313202..0000000 --- a/test/unit/person_notifier_helper_test.rb +++ /dev/null @@ -1,23 +0,0 @@ -require_relative "../test_helper" - -class PersonNotifierHelperTest < ActionView::TestCase - - include PersonNotifierHelper - - def setup - @profile = mock - @env = Environment.new - end - attr_reader :profile, :env - - should 'append top url of environment at image path' do - profile.expects(:environment).returns(env).at_least_once - assert_match /src="http:\/\/localhost\/image.png"/, image_tag("/image.png") - end - - should 'return original path if do not have an environment' do - profile.expects(:environment).returns(nil).at_least_once - assert_match /src="\/image.png"/, image_tag("/image.png") - end - -end -- libgit2 0.21.2