summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-01-03 15:54:49 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-01-03 15:54:49 +0000
commita4d3da988a3e9f7a7d246ef7e80d11c92270f13b (patch)
tree0a6eda88083c2baf6252d2d33705ec6d5a753ccc /test/integration
parent58a63c49c49bfdde9ad1d5db5157662ca60c2c8e (diff)
downloadredmine-a4d3da988a3e9f7a7d246ef7e80d11c92270f13b.tar.gz
redmine-a4d3da988a3e9f7a7d246ef7e80d11c92270f13b.zip
Allow filtering with timestamp (#8842).
git-svn-id: http://svn.redmine.org/redmine/trunk@12477 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/api_test/issues_test.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/integration/api_test/issues_test.rb b/test/integration/api_test/issues_test.rb
index d8f1dad48..a8839a391 100644
--- a/test/integration/api_test/issues_test.rb
+++ b/test/integration/api_test/issues_test.rb
@@ -162,6 +162,29 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
end
end
+ def test_index_should_allow_timestamp_filtering
+ Issue.delete_all
+ Issue.generate!(:subject => '1').update_column(:updated_on, Time.parse("2014-01-02T10:25:00Z"))
+ Issue.generate!(:subject => '2').update_column(:updated_on, Time.parse("2014-01-02T12:13:00Z"))
+
+ get '/issues.xml',
+ {:set_filter => 1, :f => ['updated_on'], :op => {:updated_on => '<='},
+ :v => {:updated_on => ['2014-01-02T12:00:00Z']}}
+ assert_select 'issues>issue', :count => 1
+ assert_select 'issues>issue>subject', :text => '1'
+
+ get '/issues.xml',
+ {:set_filter => 1, :f => ['updated_on'], :op => {:updated_on => '>='},
+ :v => {:updated_on => ['2014-01-02T12:00:00Z']}}
+ assert_select 'issues>issue', :count => 1
+ assert_select 'issues>issue>subject', :text => '2'
+
+ get '/issues.xml',
+ {:set_filter => 1, :f => ['updated_on'], :op => {:updated_on => '>='},
+ :v => {:updated_on => ['2014-01-02T08:00:00Z']}}
+ assert_select 'issues>issue', :count => 2
+ end
+
context "/index.json" do
should_allow_api_authentication(:get, "/projects/private-child/issues.json")
end