summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-10-23 11:07:04 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-10-23 11:07:04 +0000
commit7824eca77561dea52960b3d094389bd4e85eeccf (patch)
treeb19e031644b9d9f67db379b20ff2eae9b08ff8e4 /test
parenteea456ed84d159289bdc8826439923d365816fa8 (diff)
downloadredmine-7824eca77561dea52960b3d094389bd4e85eeccf.tar.gz
redmine-7824eca77561dea52960b3d094389bd4e85eeccf.zip
Refactor: merged error rendering methods.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4286 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/issues_controller_test.rb8
-rw-r--r--test/test_helper.rb6
2 files changed, 7 insertions, 7 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 59b16c32c..48ab8cef6 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -340,9 +340,7 @@ class IssuesControllerTest < ActionController::TestCase
get :new, :project_id => 1
assert_response 500
- assert_not_nil flash[:error]
- assert_tag :tag => 'div', :attributes => { :class => /error/ },
- :content => /No default issue/
+ assert_error_tag :content => /No default issue/
end
def test_get_new_with_no_tracker_should_display_an_error
@@ -351,9 +349,7 @@ class IssuesControllerTest < ActionController::TestCase
get :new, :project_id => 1
assert_response 500
- assert_not_nil flash[:error]
- assert_tag :tag => 'div', :attributes => { :class => /error/ },
- :content => /No tracker/
+ assert_error_tag :content => /No tracker/
end
def test_update_new_form
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 9a2761021..eea1a03b5 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -113,11 +113,15 @@ class ActiveSupport::TestCase
def self.repository_configured?(vendor)
File.directory?(repository_path(vendor))
end
+
+ def assert_error_tag(options={})
+ assert_tag({:tag => 'p', :attributes => { :id => 'errorExplanation' }}.merge(options))
+ end
# Shoulda macros
def self.should_render_404
should_respond_with :not_found
- should_render_template 'common/404'
+ should_render_template 'common/error'
end
def self.should_have_before_filter(expected_method, options = {})