Add "Assign to me" shortcut to issue edit form (#29285).

Patch by Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@19539 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2020-02-29 06:13:24 +00:00
parent 6b0afdc9ca
commit 700ad847da
5 changed files with 67 additions and 2 deletions

View File

@@ -2105,6 +2105,43 @@ class IssuesControllerTest < Redmine::ControllerTest
end
end
def test_update_form_should_render_assign_to_me_link_when_issue_can_be_assigned_to_the_current_user
@request.session[:user_id] = 1
get :show, :params => {
:id => 10
}
assert_select 'form#issue-form #attributes' do
assert_select 'a[class=?][data-id=?]', 'assign-to-me-link', '1', 1
end
end
def test_update_form_should_not_render_assign_to_me_link_when_issue_cannot_be_assigned_to_the_current_user
@request.session[:user_id] = 1
get :show, :params => {
:id => 2
}
assert_select 'form#issue-form #attributes' do
assert_select 'a[class=?]', 'assign-to-me-link', 0
end
end
def test_update_form_should_not_show_assign_to_me_link_when_issue_is_assigned_to_the_current_user
issue = Issue.find(10)
issue.assigned_to_id = 1
issue.save!
@request.session[:user_id] = 1
get :show, :params => {
:id => 10
}
assert_select 'form#issue-form #attributes' do
assert_select 'a[class=?]', 'assign-to-me-link hidden', 1
end
end
def test_show_should_deny_anonymous_access_without_permission
Role.anonymous.remove_permission!(:view_issues)
get(:show, :params => {:id => 1})