Commit 933c1af2 authored by jplang's avatar jplang

Refresh watchers list when watching/unwatching an issue (#4334).

git-svn-id: https://svn.redmine.org/redmine/trunk@14238 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent b968236a
<% selector = ".#{watcher_css(watched)}" %>
$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")});
$('#watchers').html('<%= escape_javascript(render(:partial => 'watchers/watchers', :locals => {:watched => watched.first})) %>');
<% if User.current.allowed_to?(:add_issue_watchers, @project) %>
<% if User.current.allowed_to?(:add_issue_watchers, watched.project) %>
<div class="contextual">
<%= link_to l(:button_add),
{:controller => 'watchers', :action => 'new', :object_type => watched.class.name.underscore, :object_id => watched},
......
......@@ -227,6 +227,17 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
assert page.first('#sidebar').has_no_content?(user.name)
end
def test_watch_should_update_watchers_list
user = User.find(2)
log_user('jsmith', 'jsmith')
visit '/issues/1'
assert page.first('#sidebar').has_content?('Watchers (0)')
page.first('a.issue-1-watcher').click
assert page.first('#sidebar').has_content?('Watchers (1)')
assert page.first('#sidebar').has_content?(user.name)
end
def test_watch_issue_via_context_menu
log_user('jsmith', 'jsmith')
visit '/issues'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment