Commit fe6c058f9a655b5378bb5a3758e1eb687cbbad4c

Authored by Antonio Terceiro
1 parent 3bf272b1

Remove dead code

app/helpers/person_notifier_helper.rb
@@ -1,15 +0,0 @@ @@ -1,15 +0,0 @@
1 -module PersonNotifierHelper  
2 -  
3 - include ApplicationHelper  
4 -  
5 - private  
6 -  
7 - def path_to_image(source)  
8 - top_url + source  
9 - end  
10 -  
11 - def top_url  
12 - top_url = @profile.environment ? @profile.environment.top_url : ''  
13 - end  
14 -  
15 -end  
app/models/person_notifier.rb
@@ -67,7 +67,7 @@ class PersonNotifier @@ -67,7 +67,7 @@ class PersonNotifier
67 67
68 class Mailer < ActionMailer::Base 68 class Mailer < ActionMailer::Base
69 69
70 - add_template_helper(PersonNotifierHelper) 70 + add_template_helper(ApplicationHelper)
71 71
72 def session 72 def session
73 {:theme => nil} 73 {:theme => nil}
test/unit/person_notifier_helper_test.rb
@@ -1,23 +0,0 @@ @@ -1,23 +0,0 @@
1 -require_relative "../test_helper"  
2 -  
3 -class PersonNotifierHelperTest < ActionView::TestCase  
4 -  
5 - include PersonNotifierHelper  
6 -  
7 - def setup  
8 - @profile = mock  
9 - @env = Environment.new  
10 - end  
11 - attr_reader :profile, :env  
12 -  
13 - should 'append top url of environment at image path' do  
14 - profile.expects(:environment).returns(env).at_least_once  
15 - assert_match /src="http:\/\/localhost\/image.png"/, image_tag("/image.png")  
16 - end  
17 -  
18 - should 'return original path if do not have an environment' do  
19 - profile.expects(:environment).returns(nil).at_least_once  
20 - assert_match /src="\/image.png"/, image_tag("/image.png")  
21 - end  
22 -  
23 -end