summaryrefslogtreecommitdiff
path: root/test/controllers/nodes_controller_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/controllers/nodes_controller_test.rb')
-rw-r--r--test/controllers/nodes_controller_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/controllers/nodes_controller_test.rb b/test/controllers/nodes_controller_test.rb
index f14e27c..99e06ae 100644
--- a/test/controllers/nodes_controller_test.rb
+++ b/test/controllers/nodes_controller_test.rb
@@ -364,7 +364,7 @@ class NodesControllerTest < ActionController::TestCase
364 364
365 test "can remove a node with an event" do 365 test "can remove a node with an event" do
366 node = create_node_with_published_page 366 node = create_node_with_published_page
367 Event.create!( 367 event = Event.create!(
368 :start_time => "2009-01-01T15:23:42".to_time, 368 :start_time => "2009-01-01T15:23:42".to_time,
369 :end_time => "2009-01-01T20:05:23".to_time, 369 :end_time => "2009-01-01T20:05:23".to_time,
370 :url => "http://events.ccc.de/congress/2082", 370 :url => "http://events.ccc.de/congress/2082",
@@ -373,10 +373,16 @@ class NodesControllerTest < ActionController::TestCase
373 :allday => true, 373 :allday => true,
374 :node_id => node.id 374 :node_id => node.id
375 ) 375 )
376 event_id = event.id
377 assert_operator Occurrence.where(event_id: event_id).count, :>, 0, "expected the event to have generated at least one occurrence before destroy"
378
376 node.destroy 379 node.destroy
377 380
381 assert_equal 0, Occurrence.where(event_id: event_id).count
382
378 login_as :quentin 383 login_as :quentin
379 get :index 384 get :index
385 assert_response :success
380 end 386 end
381 387
382 test "show renders events row and add-link for zero-event chapter node" do 388 test "show renders events row and add-link for zero-event chapter node" do