| 31 |
31 |
assert_select 'description', :text => 'Select one of the databases'
|
| 32 |
32 |
assert_select 'id', :text => '2'
|
| 33 |
33 |
assert_select 'customized_type', :text => 'issue'
|
|
34 |
assert_select 'is_for_all', :text => 'true'
|
| 34 |
35 |
assert_select 'possible_values[type=array]' do
|
| 35 |
36 |
assert_select 'possible_value>value', :text => 'PostgreSQL'
|
| 36 |
37 |
assert_select 'possible_value>label', :text => 'PostgreSQL'
|
| 37 |
38 |
end
|
|
39 |
assert_select 'projects[type=array]'
|
| 38 |
40 |
assert_select 'trackers[type=array]'
|
| 39 |
41 |
assert_select 'roles[type=array]'
|
| 40 |
42 |
assert_select 'visible', :text => 'true'
|
| ... | ... | |
| 57 |
59 |
end
|
| 58 |
60 |
end
|
| 59 |
61 |
|
|
62 |
test "GET /custom_fields.xml should include projects for issue custom fields limited to projects" do
|
|
63 |
get '/custom_fields.xml', :headers => credentials('admin')
|
|
64 |
assert_response :success
|
|
65 |
|
|
66 |
xml = Hash.from_xml(response.body)
|
|
67 |
field = xml['custom_fields'].detect {|f| f['id'] == '9'}
|
|
68 |
assert_kind_of Hash, field
|
|
69 |
assert_equal 'false', field['is_for_all']
|
|
70 |
assert_kind_of Array, field['projects']
|
|
71 |
assert_equal [{'id' => '1', 'name' => 'eCookbook'}], field['projects']
|
|
72 |
end
|
|
73 |
|
|
74 |
test "GET /custom_fields.xml should include empty projects for issue custom fields for all projects" do
|
|
75 |
get '/custom_fields.xml', :headers => credentials('admin')
|
|
76 |
assert_response :success
|
|
77 |
|
|
78 |
xml = Hash.from_xml(response.body)
|
|
79 |
field = xml['custom_fields'].detect {|f| f['id'] == '1'}
|
|
80 |
assert_kind_of Hash, field
|
|
81 |
assert_equal 'true', field['is_for_all']
|
|
82 |
assert_equal [], field['projects']
|
|
83 |
end
|
|
84 |
|
|
85 |
test "GET /custom_fields.xml should not include projects for custom fields that are not issue custom fields" do
|
|
86 |
get '/custom_fields.xml', :headers => credentials('admin')
|
|
87 |
assert_response :success
|
|
88 |
|
|
89 |
xml = Hash.from_xml(response.body)
|
|
90 |
field = xml['custom_fields'].detect {|f| f['id'] == '3'}
|
|
91 |
assert_kind_of Hash, field
|
|
92 |
assert_not field.has_key?('projects')
|
|
93 |
end
|
|
94 |
|
| 60 |
95 |
test "GET /custom_fields.xml should include roles for custom fields visible by role" do
|
| 61 |
96 |
custom_fields = [
|
| 62 |
97 |
IssueCustomField.generate!(:visible => false, :role_ids => [1, 2]),
|