From 8b5bbd83c4b08e4ad3f2555e0902ad67517f7113 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Tue, 9 Sep 2008 22:22:42 +0200 Subject: [PATCH] fix error in test somehow in running the test the image is rendered with an extra dot like blank.png.?123456789 this is not the case when you look at the rendered html in the webbrowser: blank.png?123456789 --- test/views/todos_helper_test.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/views/todos_helper_test.rb b/test/views/todos_helper_test.rb index 843d859e..74825687 100644 --- a/test/views/todos_helper_test.rb +++ b/test/views/todos_helper_test.rb @@ -49,20 +49,22 @@ class TodosHelperTest < Test::Rails::HelperTestCase def test_remote_star_icon_unstarred @todo = flexmock(:id => 1, :to_param => 1, :description => 'Get gas', :starred? => false) - assert_remote_star_icon_helper_matches %r{Blank} + # added dot (.) to regexp because somehouw the extra dot is added in the tests while its not in the rendered html + assert_remote_star_icon_helper_matches %r{Blank} assert_behavior_registered end def test_remote_star_icon_starred @todo = flexmock(:id => 1, :to_param => 1, :description => 'Get gas', :starred? => true) - assert_remote_star_icon_helper_matches %r{Blank} + # added dot (.) to regexp because somehouw the extra dot is added in the tests while its not in the rendered html + assert_remote_star_icon_helper_matches %r{Blank} assert_behavior_registered end def assert_remote_star_icon_helper_matches(regex) @controller.send :initialise_js_behaviours #simulate before filter output = remote_star_icon - #puts output + # puts output assert output =~ regex @controller.send :store_js_behaviours #simulate after filter end @@ -74,7 +76,7 @@ class TodosHelperTest < Test::Rails::HelperTestCase rule = behaviors[:rules][0] assert_equal ".item-container a.star_item:click", rule[0] assert_equal "new Ajax.Request(this.href, {asynchronous:true, evalScripts:true, method:'put', parameters:{ _source_view : '' }})\n; return false;", - rule[1] + rule[1] end def protect_against_forgery?