summaryrefslogtreecommitdiffstats
path: root/test/integration/api_test
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2021-11-15 21:58:39 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2021-11-15 21:58:39 +0000
commit70f8ca64dd9337e40b551e0ab876273a742a7551 (patch)
tree3a2c84965bcdf63d8c75aadd39612fb743e012a2 /test/integration/api_test
parent9def0fa3d06cebf49e306d9eadfcc97745087a9e (diff)
downloadredmine-70f8ca64dd9337e40b551e0ab876273a742a7551.tar.gz
redmine-70f8ca64dd9337e40b551e0ab876273a742a7551.zip
You can configure default project queries in the following places (#35795):
* App-level: Administration > Projects > Default query (Projects list defaults section) * User-level: My account > Default project query git-svn-id: http://svn.redmine.org/redmine/trunk@21281 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/api_test')
-rw-r--r--test/integration/api_test/projects_test.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/integration/api_test/projects_test.rb b/test/integration/api_test/projects_test.rb
index 0785aecb5..789847db7 100644
--- a/test/integration/api_test/projects_test.rb
+++ b/test/integration/api_test/projects_test.rb
@@ -22,7 +22,8 @@ require File.expand_path('../../../test_helper', __FILE__)
class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
fixtures :projects, :versions, :users, :roles, :members, :member_roles, :issues, :journals, :journal_details,
:trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations, :boards, :messages,
- :attachments, :custom_fields, :custom_values, :custom_fields_projects, :time_entries, :issue_categories
+ :attachments, :custom_fields, :custom_values, :custom_fields_projects, :time_entries, :issue_categories,
+ :queries
def setup
super
@@ -212,6 +213,18 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
assert_equal version.name, json['project']['default_version']['name']
end
+ def test_get_project_should_not_load_default_query
+ query = ProjectQuery.find(11)
+ ProjectQuery.stubs(:default).returns query
+
+ get '/projects.json'
+
+ assert results = JSON.parse(@response.body)['projects']
+
+ assert_equal 4, results.count
+ assert results.detect{ |i| i['name'] == "eCookbook"}
+ end
+
test "POST /projects.xml with valid parameters should create the project" do
with_settings :default_projects_modules => ['issue_tracking', 'repository'] do
assert_difference('Project.count') do