From 13e275ef0c18cfd09b30fcdc78715eed8538089d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com> Date: Thu, 11 May 2023 11:43:58 +0200 Subject: [PATCH] remove old file --- .../communication/website/connections_test.rb | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 test/models/communication/website/connections_test.rb diff --git a/test/models/communication/website/connections_test.rb b/test/models/communication/website/connections_test.rb deleted file mode 100644 index b48007b29..000000000 --- a/test/models/communication/website/connections_test.rb +++ /dev/null @@ -1,56 +0,0 @@ -require "test_helper" - -# rails test test/models/communication/website/connections_test.rb -class Communication::Website::ConnectionsTest < ActiveSupport::TestCase - test "connect objects to page" do - - # Au début, rien - page = communication_website_pages(:page_with_no_dependency) - assert_no_difference("Communication::Website::Connection.count") do - page.save - end - - # On ajoute un block "Chapitre" : +1 - assert_difference -> { Communication::Website::Connection.count } => 1 do - page.blocks.create(position: 1, published: true, template_kind: :chapter) - end - - # On connecte PA via un block "Personnes" : +2 - assert_difference -> { Communication::Website::Connection.count } => 2 do - block = page.blocks.create(position: 2, published: true, template_kind: :organization_chart) - block.data = "{ \"elements\": [ { \"id\": \"#{pa.id}\" } ] }" - block.save - end - - # On ajoute noesya via un block "Organisations" : +4 parce que noesya a un block "Personnes" avec Olivia - assert_difference -> { Communication::Website::Connection.count } => 4 do - block = page.blocks.create(position: 3, published: true, template_kind: :partners) - block.data = "{ \"elements\": [ { \"id\": \"#{noesya.id}\" } ] }" - block.save - end - - # On ajoute Arnaud à noesya via un block "Personnes" : +2 - assert_difference -> { Communication::Website::Connection.count } => 2 do - block = noesya.blocks.create(position: 2, published: true, template_kind: :organization_chart) - block.data = "{ \"elements\": [ { \"id\": \"#{arnaud.id}\" } ] }" - block.save - end - - # On tente la boucle infine en ajoutant noesya à Olivia : +1 (le block ajouté à Olivia) - assert_difference -> { Communication::Website::Connection.count } => 1 do - block = olivia.blocks.create(position: 1, published: true, template_kind: :partners) - block.data = "{ \"elements\": [ { \"id\": \"#{noesya.id}\" } ] }" - block.save - end - - # On dépublie un bloc : +0 - assert_no_difference("Communication::Website::Connection.count") do - page.blocks.second.update(published: false) - end - - # On supprime le bloc qui contient PA : -2 - assert_difference -> { Communication::Website::Connection.count } => -2 do - page.blocks.find_by(position: 2).destroy - end - end -end -- GitLab