"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/integration/api_test/projects_test.rb" between
redmine-4.1.0.tar.gz and redmine-4.1.1.tar.gz

About: Redmine is a flexible project management and bug-tracking web application (using the Ruby on Rails framework). It supports also project wikis and forums, documents management, and multiple version control systems.

projects_test.rb  (redmine-4.1.0):projects_test.rb  (redmine-4.1.1)
skipping to change at line 111 skipping to change at line 111
end end
test "GET /projects/:id.json should return the project" do test "GET /projects/:id.json should return the project" do
get '/projects/1.json' get '/projects/1.json'
json = ActiveSupport::JSON.decode(response.body) json = ActiveSupport::JSON.decode(response.body)
assert_kind_of Hash, json assert_kind_of Hash, json
assert_kind_of Hash, json['project'] assert_kind_of Hash, json['project']
assert_equal 1, json['project']['id'] assert_equal 1, json['project']['id']
assert_equal false, json['project']['inherit_members'] assert_equal false, json['project']['inherit_members']
assert_equal false, json['project'].has_key?('default_version')
assert_equal false, json['project'].has_key?('default_assignee')
end end
test "GET /projects/:id.xml with hidden custom fields should not display hidde n custom fields" do test "GET /projects/:id.xml with hidden custom fields should not display hidde n custom fields" do
ProjectCustomField.find_by_name('Development status').update_attribute :visi ble, false ProjectCustomField.find_by_name('Development status').update_attribute :visi ble, false
get '/projects/1.xml' get '/projects/1.xml'
assert_response :success assert_response :success
assert_equal 'application/xml', @response.content_type assert_equal 'application/xml', @response.content_type
assert_select 'custom_field[name=?]', 'Development status', 0 assert_select 'custom_field[name=?]', 'Development status', 0
skipping to change at line 155 skipping to change at line 157
end end
test "GET /projects/:id.xml with include=enabled_modules should return enabled modules" do test "GET /projects/:id.xml with include=enabled_modules should return enabled modules" do
get '/projects/1.xml?include=enabled_modules' get '/projects/1.xml?include=enabled_modules'
assert_response :success assert_response :success
assert_equal 'application/xml', @response.content_type assert_equal 'application/xml', @response.content_type
assert_select 'enabled_modules[type=array] enabled_module[name=issue_trackin g]' assert_select 'enabled_modules[type=array] enabled_module[name=issue_trackin g]'
end end
def test_get_project_with_default_version_and_assignee
user = User.find(3)
version = Version.find(1)
Project.find(1).update!(default_assigned_to_id: user.id, default_version_id:
version.id)
get '/projects/1.json'
json = ActiveSupport::JSON.decode(response.body)
assert_kind_of Hash, json
assert_kind_of Hash, json['project']
assert_equal 1, json['project']['id']
assert json['project'].has_key?('default_assignee')
assert_equal 2, json['project']['default_assignee'].length
assert_equal user.id, json['project']['default_assignee']['id']
assert_equal user.name, json['project']['default_assignee']['name']
assert json['project'].has_key?('default_version')
assert_equal 2, json['project']['default_version'].length
assert_equal version.id, json['project']['default_version']['id']
assert_equal version.name, json['project']['default_version']['name']
end
test "POST /projects.xml with valid parameters should create the project" do test "POST /projects.xml with valid parameters should create the project" do
with_settings :default_projects_modules => ['issue_tracking', 'repository'] do with_settings :default_projects_modules => ['issue_tracking', 'repository'] do
assert_difference('Project.count') do assert_difference('Project.count') do
post '/projects.xml', post '/projects.xml',
:params => {:project => {:name => 'API test', :identifier => 'api-test '}}, :params => {:project => {:name => 'API test', :identifier => 'api-test '}},
:headers => credentials('admin') :headers => credentials('admin')
end end
end end
project = Project.order('id DESC').first project = Project.order('id DESC').first
 End of changes. 2 change blocks. 
0 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)