diff options
Diffstat (limited to 'test/integration/api_test/projects_test.rb')
-rw-r--r-- | test/integration/api_test/projects_test.rb | 15 |
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 |