DOn't show time entries when query is invalid (#23912).

git-svn-id: http://svn.redmine.org/redmine/trunk@16635 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2017-06-07 19:56:22 +00:00
parent 7814772918
commit c513037c6e
3 changed files with 12 additions and 0 deletions

View File

@@ -989,6 +989,14 @@ class TimelogControllerTest < Redmine::ControllerTest
assert_equal 3, values.size
end
def test_index_with_invalid_date_filter_should_not_validate
@request.session[:user_id] = 2
get :index, :params => {:set_filter => '1', :f => ['spent_on'], :op => {'spent_on' => '='}, :v => {'spent_on' => ['2016-09-010']}}
assert_select_error 'Date is invalid'
assert_select 'table.time-entries', 0
end
def test_index_with_query
query = TimeEntryQuery.new(:project_id => 1, :name => 'Time Entry Query', :visibility => 2)
query.save!