Commit 061eb85d6fb4c3a40099f59c24ac1821020354fa
Committed by
Antonio Terceiro
1 parent
edf4bc2c
Exists in
master
and in
29 other branches
fixing application helper tests
Showing
2 changed files
with
15 additions
and
5 deletions
Show diff stats
UPGRADE
@@ -25,3 +25,13 @@ I used the solution 1. | @@ -25,3 +25,13 @@ I used the solution 1. | ||
25 | I solved an incompatibility between paginate and geokit with an work around like this the one explained on the link: | 25 | I solved an incompatibility between paginate and geokit with an work around like this the one explained on the link: |
26 | 26 | ||
27 | http://groups.google.com/group/will_paginate/browse_thread/thread/1bbb1f0c5810f1c1 | 27 | http://groups.google.com/group/will_paginate/browse_thread/thread/1bbb1f0c5810f1c1 |
28 | + | ||
29 | +5 - The test of this method 'theme_include' of application helper was not passing. | ||
30 | + | ||
31 | +I changed the tests | ||
32 | + - "should 'render theme footer' do" | ||
33 | + - " should 'ignore unexisting theme footer' do" | ||
34 | + | ||
35 | + to make the test usefull | ||
36 | + | ||
37 | + |
test/unit/application_helper_test.rb
@@ -148,19 +148,19 @@ class ApplicationHelperTest < Test::Unit::TestCase | @@ -148,19 +148,19 @@ class ApplicationHelperTest < Test::Unit::TestCase | ||
148 | 148 | ||
149 | should 'render theme footer' do | 149 | should 'render theme footer' do |
150 | stubs(:theme_path).returns('/user_themes/mytheme') | 150 | stubs(:theme_path).returns('/user_themes/mytheme') |
151 | - footer = '../../public/user_themes/mytheme/footer.rhtml' | 151 | + footer_path = RAILS_ROOT + '/public/user_themes/mytheme/footer.rhtml' |
152 | 152 | ||
153 | - File.expects(:exists?).with(RAILS_ROOT + '/app/views/../../public/user_themes/mytheme/footer.rhtml').returns(true) | ||
154 | - expects(:render).with(:file => footer).returns("BLI") | 153 | + File.expects(:exists?).with(footer_path).returns(true) |
154 | + expects(:render).with(:file => footer_path, :use_full_path => false).returns("BLI") | ||
155 | 155 | ||
156 | assert_equal "BLI", theme_footer | 156 | assert_equal "BLI", theme_footer |
157 | end | 157 | end |
158 | 158 | ||
159 | should 'ignore unexisting theme footer' do | 159 | should 'ignore unexisting theme footer' do |
160 | stubs(:theme_path).returns('/user_themes/mytheme') | 160 | stubs(:theme_path).returns('/user_themes/mytheme') |
161 | - footer = '../../public/user_themes/mytheme/footer.rhtml' | 161 | + footer_path = RAILS_ROOT + '/public/user_themes/mytheme/footer.rhtml' |
162 | 162 | ||
163 | - File.expects(:exists?).with(RAILS_ROOT + '/app/views/../../public/user_themes/mytheme/footer.rhtml').returns(false) | 163 | + File.expects(:exists?).with(footer_path).returns(false) |
164 | expects(:render).with(:file => footer).never | 164 | expects(:render).with(:file => footer).never |
165 | 165 | ||
166 | assert_nil theme_footer | 166 | assert_nil theme_footer |