Defect #43869 » 43869.patch
| app/views/issues/new.js.erb | ||
|---|---|---|
| 4 | 4 |
$("#watchers_form_container").html(
|
| 5 | 5 |
'<%= escape_javascript(render :partial => 'issues/watchers_form') %>'); |
| 6 | 6 |
<% when "issue_category_id" %> |
| 7 |
$('#issue_assigned_to_id').find('option').first().html(
|
|
| 8 |
'<%= escape_javascript( |
|
| 9 |
@issue.category.try(:assigned_to).try(:name)).presence || ' '.html_safe %>'); |
|
| 7 |
$('#issue_assigned_to_id').find('option').first()
|
|
| 8 |
// Browsers prefer option[label] over inner text, so remove the blank label. |
|
| 9 |
.removeAttr('label')
|
|
| 10 |
.html( |
|
| 11 |
'<%= escape_javascript( |
|
| 12 |
@issue.category.try(:assigned_to).try(:name)).presence || ' '.html_safe %>'); |
|
| 10 | 13 |
<% end %> |
| test/functional/issues_controller_test.rb | ||
|---|---|---|
| 4242 | 4242 |
end |
| 4243 | 4243 |
end |
| 4244 | 4244 | |
| 4245 |
def test_update_form_for_new_issue_should_show_category_default_assignee_when_changing_category |
|
| 4246 |
@request.session[:user_id] = 2 |
|
| 4247 | ||
| 4248 |
post( |
|
| 4249 |
:new, |
|
| 4250 |
:params => {
|
|
| 4251 |
:project_id => 1, |
|
| 4252 |
:issue => {
|
|
| 4253 |
:category_id => 1 |
|
| 4254 |
}, |
|
| 4255 |
:form_update_triggered_by => 'issue_category_id' |
|
| 4256 |
}, |
|
| 4257 |
:xhr => true |
|
| 4258 |
) |
|
| 4259 |
assert_response :success |
|
| 4260 | ||
| 4261 |
# Browsers prefer option[label] over inner text, so the blank label must be removed. |
|
| 4262 |
assert_includes @response.body, ".removeAttr('label')"
|
|
| 4263 |
assert_includes @response.body, "John Smith" |
|
| 4264 |
end |
|
| 4265 | ||
| 4245 | 4266 |
def test_post_create |
| 4246 | 4267 |
@request.session[:user_id] = 2 |
| 4247 | 4268 |
assert_difference 'Issue.count' do |
- « Previous
- 1
- 2
- Next »