summaryrefslogtreecommitdiffstats
path: root/test/functional/timelog_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-05 11:40:31 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-05 11:40:31 +0000
commit1af6527e427bcfeba189eac10c3642fa177dfa6e (patch)
treef9410a6ec5fd5bf6b0f52d72e90d131274e9347e /test/functional/timelog_controller_test.rb
parentefccc61d79d35c25c44dc87148b0943c4fd007cb (diff)
downloadredmine-1af6527e427bcfeba189eac10c3642fa177dfa6e.tar.gz
redmine-1af6527e427bcfeba189eac10c3642fa177dfa6e.zip
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5319 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/timelog_controller_test.rb')
-rw-r--r--test/functional/timelog_controller_test.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb
index 0fa7f5729..611420a28 100644
--- a/test/functional/timelog_controller_test.rb
+++ b/test/functional/timelog_controller_test.rb
@@ -213,19 +213,13 @@ class TimelogControllerTest < ActionController::TestCase
def test_destroy_should_fail
# simulate that this fails (e.g. due to a plugin), see #5700
- TimeEntry.class_eval do
- before_destroy :stop_callback_chain
- def stop_callback_chain ; return false ; end
- end
+ TimeEntry.any_instance.expects(:destroy).returns(false)
@request.session[:user_id] = 2
delete :destroy, :id => 1
assert_redirected_to :action => 'index', :project_id => 'ecookbook'
assert_equal I18n.t(:notice_unable_delete_time_entry), flash[:error]
assert_not_nil TimeEntry.find_by_id(1)
-
- # remove the simulation
- TimeEntry.before_destroy.reject! {|callback| callback.method == :stop_callback_chain }
end
def test_index_all_projects