##// END OF EJS Templates
Code cleanup....
Jean-Philippe Lang -
r5199:1af6527e427b
parent child
Show More
@@ -213,19 +213,13 class TimelogControllerTest < ActionController::TestCase
213 213
214 214 def test_destroy_should_fail
215 215 # simulate that this fails (e.g. due to a plugin), see #5700
216 TimeEntry.class_eval do
217 before_destroy :stop_callback_chain
218 def stop_callback_chain ; return false ; end
219 end
216 TimeEntry.any_instance.expects(:destroy).returns(false)
220 217
221 218 @request.session[:user_id] = 2
222 219 delete :destroy, :id => 1
223 220 assert_redirected_to :action => 'index', :project_id => 'ecookbook'
224 221 assert_equal I18n.t(:notice_unable_delete_time_entry), flash[:error]
225 222 assert_not_nil TimeEntry.find_by_id(1)
226
227 # remove the simulation
228 TimeEntry.before_destroy.reject! {|callback| callback.method == :stop_callback_chain }
229 223 end
230 224
231 225 def test_index_all_projects
General Comments 0
You need to be logged in to leave comments. Login now