<p>
<label><%= l(:label_tracker) %></label>
<%= select_tag('source_tracker_id',
- "<option value=\"\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" +
- "<option value=\"any\">--- #{ l(:label_copy_same_as_target) } ---</option>" +
+ content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---", :value => '') +
+ content_tag('option', "--- #{ l(:label_copy_same_as_target) } ---", :value => 'any') +
options_from_collection_for_select(@trackers, 'id', 'name', @source_tracker && @source_tracker.id)) %>
</p>
<p>
<label><%= l(:label_role) %></label>
<%= select_tag('source_role_id',
- "<option value=\"\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" +
- "<option value=\"any\">--- #{ l(:label_copy_same_as_target) } ---</option>" +
+ content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---", :value => '') +
+ content_tag('option', "--- #{ l(:label_copy_same_as_target) } ---", :value => 'any') +
options_from_collection_for_select(@roles, 'id', 'name', @source_role && @source_role.id)) %>
</p>
</fieldset>
<p>
<label><%= l(:label_tracker) %></label>
<%= select_tag 'target_tracker_ids',
- "<option value=\"\" disabled=\"disabled\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" +
+ content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---", :value => '', :disabled => true) +
options_from_collection_for_select(@trackers, 'id', 'name', @target_trackers && @target_trackers.map(&:id)), :multiple => true %>
</p>
<p>
<label><%= l(:label_role) %></label>
<%= select_tag 'target_role_ids',
- "<option value=\"\" disabled=\"disabled\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" +
+ content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---", :value => '', :disabled => true) +
options_from_collection_for_select(@roles, 'id', 'name', @target_roles && @target_roles.map(&:id)), :multiple => true %>
</p>
</fieldset>
get :copy
assert_response :success
assert_template 'copy'
+ assert_select 'select[name=source_tracker_id]' do
+ assert_select 'option[value=1]', :text => 'Bug'
+ end
+ assert_select 'select[name=source_role_id]' do
+ assert_select 'option[value=2]', :text => 'Developer'
+ end
+ assert_select 'select[name=?]', 'target_tracker_ids[]' do
+ assert_select 'option[value=3]', :text => 'Support request'
+ end
+ assert_select 'select[name=?]', 'target_role_ids[]' do
+ assert_select 'option[value=1]', :text => 'Manager'
+ end
end
def test_post_copy_one_to_one