108 |
108 |
assert_kind_of Hash, json['project']
|
109 |
109 |
assert_equal 1, json['project']['id']
|
110 |
110 |
assert_equal false, json['project']['inherit_members']
|
|
111 |
assert_equal false, json['project'].has_key?('default_version')
|
|
112 |
assert_equal false, json['project'].has_key?('default_assignee')
|
111 |
113 |
end
|
112 |
114 |
|
113 |
115 |
test "GET /projects/:id.xml with hidden custom fields should not display hidden custom fields" do
|
... | ... | |
152 |
154 |
assert_select 'enabled_modules[type=array] enabled_module[name=issue_tracking]'
|
153 |
155 |
end
|
154 |
156 |
|
|
157 |
def test_get_project_with_default_version_and_assignee
|
|
158 |
user = User.find(3)
|
|
159 |
version = Version.find(1)
|
|
160 |
Project.find(1).update!(default_assigned_to_id: user.id, default_version_id: version.id)
|
|
161 |
|
|
162 |
get '/projects/1.json'
|
|
163 |
|
|
164 |
json = ActiveSupport::JSON.decode(response.body)
|
|
165 |
assert_kind_of Hash, json
|
|
166 |
assert_kind_of Hash, json['project']
|
|
167 |
assert_equal 1, json['project']['id']
|
|
168 |
puts json.inspect
|
|
169 |
|
|
170 |
assert json['project'].has_key?('default_assignee')
|
|
171 |
assert_equal 2, json['project']['default_assignee'].length
|
|
172 |
assert_equal user.id, json['project']['default_assignee']['id']
|
|
173 |
assert_equal user.name, json['project']['default_assignee']['name']
|
|
174 |
|
|
175 |
assert json['project'].has_key?('default_version')
|
|
176 |
assert_equal 2, json['project']['default_version'].length
|
|
177 |
assert_equal version.id, json['project']['default_version']['id']
|
|
178 |
assert_equal version.name, json['project']['default_version']['name']
|
|
179 |
end
|
|
180 |
|
155 |
181 |
test "POST /projects.xml with valid parameters should create the project" do
|
156 |
182 |
with_settings :default_projects_modules => ['issue_tracking', 'repository'] do
|
157 |
183 |
assert_difference('Project.count') do
|