diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-23 18:04:37 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-23 18:04:37 +0200 |
| commit | 6424e10be5a89f175a74c71c55660412a169b8b8 (patch) | |
| tree | ae8c8111bd1e8c6e82c0a5f9a2c4b088c92bafe5 /test | |
| parent | 375ed745052148faeb34763087fe04214105f1b8 (diff) | |
Update deployed state to what's currently running
Diffstat (limited to 'test')
| -rw-r--r-- | test/functional/nodes_controller_test.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/functional/nodes_controller_test.rb b/test/functional/nodes_controller_test.rb index 113697a..f5a16ee 100644 --- a/test/functional/nodes_controller_test.rb +++ b/test/functional/nodes_controller_test.rb | |||
| @@ -347,4 +347,40 @@ class NodesControllerTest < ActionController::TestCase | |||
| 347 | assert_equal "quentin", node.draft.user.login | 347 | assert_equal "quentin", node.draft.user.login |
| 348 | assert_equal "aaron", node.draft.editor.login | 348 | assert_equal "aaron", node.draft.editor.login |
| 349 | end | 349 | end |
| 350 | |||
| 351 | test "destroy a published node" do | ||
| 352 | node = create_node_with_published_page | ||
| 353 | node.destroy | ||
| 354 | |||
| 355 | login_as :quentin | ||
| 356 | get :index | ||
| 357 | end | ||
| 358 | |||
| 359 | test "no dangling pages remain after node removal" do | ||
| 360 | node = create_node_with_published_page | ||
| 361 | page_id = node.pages.first.id | ||
| 362 | node.destroy | ||
| 363 | |||
| 364 | assert_raises(ActiveRecord::RecordNotFound) do | ||
| 365 | assert Page.find page_id | ||
| 366 | end | ||
| 367 | end | ||
| 368 | |||
| 369 | test "can remove a node with an event" do | ||
| 370 | node = create_node_with_published_page | ||
| 371 | Event.create!( | ||
| 372 | :start_time => "2009-01-01T15:23:42".to_time, | ||
| 373 | :end_time => "2009-01-01T20:05:23".to_time, | ||
| 374 | :url => "http://events.ccc.de/congress/2082", | ||
| 375 | :latitude => 52.525308, | ||
| 376 | :longitude => 13.378944, | ||
| 377 | :allday => true, | ||
| 378 | :node_id => node.id | ||
| 379 | ) | ||
| 380 | node.destroy | ||
| 381 | |||
| 382 | login_as :quentin | ||
| 383 | get :index | ||
| 384 | end | ||
| 385 | |||
| 350 | end | 386 | end |
