Mercurial > hg > soundsoftware-site
comparison test/unit/helpers/watchers_helper_test.rb @ 1517:dffacf8a6908 redmine-2.5
Update to Redmine SVN revision 13367 on 2.5-stable branch
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 09:29:00 +0100 |
parents | e248c7af89ec |
children |
comparison
equal
deleted
inserted
replaced
1516:b450a9d58aed | 1517:dffacf8a6908 |
---|---|
18 require File.expand_path('../../../test_helper', __FILE__) | 18 require File.expand_path('../../../test_helper', __FILE__) |
19 | 19 |
20 class WatchersHelperTest < ActionView::TestCase | 20 class WatchersHelperTest < ActionView::TestCase |
21 include WatchersHelper | 21 include WatchersHelper |
22 include Redmine::I18n | 22 include Redmine::I18n |
23 include Rails.application.routes.url_helpers | |
23 | 24 |
24 fixtures :users, :issues | 25 fixtures :users, :issues |
25 | 26 |
26 def setup | 27 def setup |
27 super | 28 super |
54 :remote => true, :method => 'post', :class => "issue-bulk-watcher icon icon-fav-off" | 55 :remote => true, :method => 'post', :class => "issue-bulk-watcher icon icon-fav-off" |
55 ) | 56 ) |
56 assert_equal expected, watcher_link([Issue.find(1), Issue.find(3)], User.find(1)) | 57 assert_equal expected, watcher_link([Issue.find(1), Issue.find(3)], User.find(1)) |
57 end | 58 end |
58 | 59 |
60 def test_watcher_link_with_nil_should_return_empty_string | |
61 assert_equal '', watcher_link(nil, User.find(1)) | |
62 end | |
63 | |
59 test '#watcher_link with a watched object' do | 64 test '#watcher_link with a watched object' do |
60 Watcher.create!(:watchable => Issue.find(1), :user => User.find(1)) | 65 Watcher.create!(:watchable => Issue.find(1), :user => User.find(1)) |
61 | 66 |
62 expected = link_to( | 67 expected = link_to( |
63 "Unwatch", | 68 "Unwatch", |