test/rails/test/functional/articles_controller_test.rb in gettext-1.10.0-mswin32 vs test/rails/test/functional/articles_controller_test.rb in gettext-1.90.0
- old
+ new
@@ -1,9 +1,11 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'articles_controller'
-RESULT_DIR = File.dirname(__FILE__) + "/../../test/result/"
+unless defined? RESULT_DIR
+ RESULT_DIR = File.dirname(__FILE__) + "/../../test/result/"
+end
# Re-raise errors caught by the controller.
class ArticlesController; def rescue_action(e) raise e end; end
class ArticlesControllerTest < Test::Unit::TestCase
@@ -20,9 +22,12 @@
def save_html(path)
open(RESULT_DIR + path, "w"){|io| io.write @response.body}
end
def assert_html(path)
+ unless File.exist?(path)
+ save_html(path)
+ end
ary = IO.readlines(RESULT_DIR + path)
i = 0
@response.body.each_line{|line|
assert_equal ary[i], line
i += 1