summaryrefslogtreecommitdiffstats
path: root/test/integration/api_test
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-12-03 13:19:09 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-12-03 13:19:09 +0000
commitae967251ecc81ad62987d8bea94f78c9387272ac (patch)
tree675998a041b2c591f4d10be872a6df0043c3e0aa /test/integration/api_test
parentb42e8c2040f050cd41cfc223c3168def8bf35c44 (diff)
downloadredmine-ae967251ecc81ad62987d8bea94f78c9387272ac.tar.gz
redmine-ae967251ecc81ad62987d8bea94f78c9387272ac.zip
fix source indent of test/integration/api_test/projects_test.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20550 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/api_test')
-rw-r--r--test/integration/api_test/projects_test.rb55
1 files changed, 44 insertions, 11 deletions
diff --git a/test/integration/api_test/projects_test.rb b/test/integration/api_test/projects_test.rb
index cd336c51c..befd8907d 100644
--- a/test/integration/api_test/projects_test.rb
+++ b/test/integration/api_test/projects_test.rb
@@ -188,9 +188,11 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
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
- post '/projects.xml',
+ post(
+ '/projects.xml',
:params => {:project => {:name => 'API test', :identifier => 'api-test'}},
:headers => credentials('admin')
+ )
end
end
@@ -207,9 +209,17 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
test "POST /projects.xml should accept enabled_module_names attribute" do
assert_difference('Project.count') do
- post '/projects.xml',
- :params => {:project => {:name => 'API test', :identifier => 'api-test', :enabled_module_names => ['issue_tracking', 'news', 'time_tracking']}},
+ post(
+ '/projects.xml',
+ :params => {
+ :project => {
+ :name => 'API test',
+ :identifier => 'api-test',
+ :enabled_module_names => ['issue_tracking', 'news', 'time_tracking']
+ }
+ },
:headers => credentials('admin')
+ )
end
project = Project.order('id DESC').first
@@ -218,9 +228,17 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
test "POST /projects.xml should accept tracker_ids attribute" do
assert_difference('Project.count') do
- post '/projects.xml',
- :params => {:project => {:name => 'API test', :identifier => 'api-test', :tracker_ids => [1, 3]}},
+ post(
+ '/projects.xml',
+ :params => {
+ :project => {
+ :name => 'API test',
+ :identifier => 'api-test',
+ :tracker_ids => [1, 3]
+ }
+ },
:headers => credentials('admin')
+ )
end
project = Project.order('id DESC').first
@@ -229,9 +247,11 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
test "POST /projects.xml with invalid parameters should return errors" do
assert_no_difference('Project.count') do
- post '/projects.xml',
+ post(
+ '/projects.xml',
:params => {:project => {:name => 'API test'}},
:headers => credentials('admin')
+ )
end
assert_response :unprocessable_entity
@@ -241,9 +261,11 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
test "PUT /projects/:id.xml with valid parameters should update the project" do
assert_no_difference 'Project.count' do
- put '/projects/2.xml',
+ put(
+ '/projects/2.xml',
:params => {:project => {:name => 'API update'}},
:headers => credentials('jsmith')
+ )
end
assert_response :no_content
assert_equal '', @response.body
@@ -254,9 +276,16 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
test "PUT /projects/:id.xml should accept enabled_module_names attribute" do
assert_no_difference 'Project.count' do
- put '/projects/2.xml',
- :params => {:project => {:name => 'API update', :enabled_module_names => ['issue_tracking', 'news', 'time_tracking']}},
+ put(
+ '/projects/2.xml',
+ :params => {
+ :project => {
+ :name => 'API update',
+ :enabled_module_names => ['issue_tracking', 'news', 'time_tracking']
+ }
+ },
:headers => credentials('admin')
+ )
end
assert_response :no_content
assert_equal '', @response.body
@@ -266,9 +295,11 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
test "PUT /projects/:id.xml should accept tracker_ids attribute" do
assert_no_difference 'Project.count' do
- put '/projects/2.xml',
+ put(
+ '/projects/2.xml',
:params => {:project => {:name => 'API update', :tracker_ids => [1, 3]}},
:headers => credentials('admin')
+ )
end
assert_response :no_content
assert_equal '', @response.body
@@ -278,9 +309,11 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
test "PUT /projects/:id.xml with invalid parameters should return errors" do
assert_no_difference('Project.count') do
- put '/projects/2.xml',
+ put(
+ '/projects/2.xml',
:params => {:project => {:name => ''}},
:headers => credentials('admin')
+ )
end
assert_response :unprocessable_entity