@@ -1,2 +1,3 | |||||
1 | <% selector = ".#{watcher_css(watched)}" %> |
|
1 | <% selector = ".#{watcher_css(watched)}" %> | |
2 | $("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")}); |
|
2 | $("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")}); | |
|
3 | $('#watchers').html('<%= escape_javascript(render(:partial => 'watchers/watchers', :locals => {:watched => watched.first})) %>'); |
@@ -1,4 +1,4 | |||||
1 |
<% if User.current.allowed_to?(:add_issue_watchers, |
|
1 | <% if User.current.allowed_to?(:add_issue_watchers, watched.project) %> | |
2 | <div class="contextual"> |
|
2 | <div class="contextual"> | |
3 | <%= link_to l(:button_add), |
|
3 | <%= link_to l(:button_add), | |
4 | {:controller => 'watchers', :action => 'new', :object_type => watched.class.name.underscore, :object_id => watched}, |
|
4 | {:controller => 'watchers', :action => 'new', :object_type => watched.class.name.underscore, :object_id => watched}, |
@@ -227,6 +227,17 class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base | |||||
227 | assert page.first('#sidebar').has_no_content?(user.name) |
|
227 | assert page.first('#sidebar').has_no_content?(user.name) | |
228 | end |
|
228 | end | |
229 |
|
229 | |||
|
230 | def test_watch_should_update_watchers_list | |||
|
231 | user = User.find(2) | |||
|
232 | log_user('jsmith', 'jsmith') | |||
|
233 | visit '/issues/1' | |||
|
234 | assert page.first('#sidebar').has_content?('Watchers (0)') | |||
|
235 | ||||
|
236 | page.first('a.issue-1-watcher').click | |||
|
237 | assert page.first('#sidebar').has_content?('Watchers (1)') | |||
|
238 | assert page.first('#sidebar').has_content?(user.name) | |||
|
239 | end | |||
|
240 | ||||
230 | def test_watch_issue_via_context_menu |
|
241 | def test_watch_issue_via_context_menu | |
231 | log_user('jsmith', 'jsmith') |
|
242 | log_user('jsmith', 'jsmith') | |
232 | visit '/issues' |
|
243 | visit '/issues' |
General Comments 0
You need to be logged in to leave comments.
Login now