96 |
96 |
|
97 |
97 |
def test_index_as_list_should_format_column_value
|
98 |
98 |
get :index, :params => {
|
99 |
|
:c => ['name', 'status', 'short_description', 'homepage', 'parent_id', 'identifier', 'is_public', 'created_on', 'project.cf_3'],
|
|
99 |
:c => ['name', 'status', 'short_description', 'homepage', 'parent_id', 'identifier', 'is_public', 'created_on', 'cf_3'],
|
100 |
100 |
:display_type => 'list'
|
101 |
101 |
}
|
102 |
102 |
assert_response :success
|
... | ... | |
111 |
111 |
assert_select 'td.identifier', :text => 'ecookbook'
|
112 |
112 |
assert_select 'td.is_public', :text => 'Yes'
|
113 |
113 |
assert_select 'td.created_on', :text => format_time(project.created_on)
|
114 |
|
assert_select 'td.project_cf_3.list', :text => 'Stable'
|
|
114 |
assert_select 'td.cf_3.list', :text => 'Stable'
|
115 |
115 |
end
|
116 |
116 |
assert_select 'tr[id=?]', 'project-4' do
|
117 |
117 |
assert_select 'td.parent_id a[href=?]', '/projects/ecookbook', :text => 'eCookbook'
|
... | ... | |
207 |
207 |
end
|
208 |
208 |
end
|
209 |
209 |
|
|
210 |
def test_index_sort_by_custom_field
|
|
211 |
@request.session[:user_id] = 1
|
|
212 |
|
|
213 |
cf = ProjectCustomField.find(3)
|
|
214 |
CustomValue.create!(:custom_field => cf, :customized => Project.find(2), :value => 'Beta')
|
|
215 |
|
|
216 |
get(
|
|
217 |
:index,
|
|
218 |
:params => {
|
|
219 |
:display_type => 'list',
|
|
220 |
:c => ['name', 'identifier', 'cf_3'],
|
|
221 |
:set_filter => 1,
|
|
222 |
:sort => "cf_#{cf.id}:asc"
|
|
223 |
}
|
|
224 |
)
|
|
225 |
assert_response :success
|
|
226 |
|
|
227 |
assert_equal(
|
|
228 |
['Beta', 'Stable'],
|
|
229 |
columns_values_in_list('cf_3').reject {|p| p.empty?}
|
|
230 |
)
|
|
231 |
end
|
|
232 |
|
210 |
233 |
def test_autocomplete_js
|
211 |
234 |
get(
|
212 |
235 |
:autocomplete,
|