Fix version select style on wp form inline create

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/2690/head
Alex Coles 10 years ago
parent 0c88caa138
commit 07d4ea4edd
  1. 5
      app/controllers/versions_controller.rb
  2. 4
      spec/controllers/versions_controller_spec.rb

@ -96,7 +96,10 @@ class VersionsController < ApplicationController
# IE doesn't support the replace_html rjs method for select box options
render(:update) {|page|
page.replace 'work_package_fixed_version_id',
content_tag('select', '<option></option>'.html_safe + version_options_for_select(@project.shared_versions.open, @version).html_safe, id: 'work_package_fixed_version_id', name: 'work_package[fixed_version_id]')
content_tag('select', '<option></option>'.html_safe + version_options_for_select(@project.shared_versions.open, @version).html_safe,
id: 'work_package_fixed_version_id',
name: 'work_package[fixed_version_id]',
class: 'form--select')
}
end
end

@ -159,7 +159,9 @@ describe VersionsController, type: :controller do
it 'returns updated select box with new version' do
version = Version.find_by_name('test_add_version_from_issue_form')
select_substring = "select id=\\\"work_package_fixed_version_id\\\" name=\\\"work_package[fixed_version_id]\\\""
select_substring = "select class=\\\"form--select\\\"
id=\\\"work_package_fixed_version_id\\\"
name=\\\"work_package[fixed_version_id]\\\"".squish
# selected option tag for the new version
option_substring = "option value=\\\"#{version.id}\\\" selected=\\\"selected\\\""

Loading…
Cancel
Save