Rescue invalid query statement error with an error message.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3104 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-11-28 10:29:48 +00:00
parent 915bbcfaff
commit 99b52c8796
3 changed files with 30 additions and 0 deletions
+7
View File
@@ -269,6 +269,13 @@ class QueryTest < ActiveSupport::TestCase
assert_equal values.sort, values
end
def test_invalid_query_should_raise_query_statement_invalid_error
q = Query.new
assert_raise Query::StatementInvalid do
q.issues(:conditions => "foo = 1")
end
end
def test_label_for
q = Query.new
assert_equal 'assigned_to', q.label_for('assigned_to_id')