From 50c191ab3c5ab079bca62abc5a582202d15d290d Mon Sep 17 00:00:00 2001 From: Bevan Loon Date: Wed, 26 Apr 2017 13:02:16 +0100 Subject: [PATCH] Remove integration tests for old emergency banner Old emergency banner code is deprecated. Remove the tests --- test/integration/notifications_test.rb | 91 -------------------------- 1 file changed, 91 deletions(-) diff --git a/test/integration/notifications_test.rb b/test/integration/notifications_test.rb index 34d6e77a5..6969b09f6 100644 --- a/test/integration/notifications_test.rb +++ b/test/integration/notifications_test.rb @@ -1,14 +1,6 @@ require 'integration_test_helper' class NotificationsTest < ActionDispatch::IntegrationTest - setup do - @original_banner = Static.banner - end - - teardown do - Static.banner = @original_banner - end - context "emergency banner file" do should "have an emergency banner file" do assert File.exist? "#{Rails.root}/app/views/notifications/_emergency_banner.html.erb" @@ -133,87 +125,4 @@ class NotificationsTest < ActionDispatch::IntegrationTest refute page.has_selector? ".global-bar-message" end end - - context "banner files" do - should "have a green file" do - assert File.exist? "#{Rails.root}/app/views/notifications/banner_green.erb" - end - - should "have a red file" do - assert File.exist? "#{Rails.root}/app/views/notifications/banner_red.erb" - end - - should "have a black file" do - assert File.exist? "#{Rails.root}/app/views/notifications/banner_black.erb" - end - end - - context "banner notifications" do - teardown do - clean_up_test_files - end - - context "given view files are empty" do - setup do - create_test_file(filename: "banner_green.erb", content: '') - create_test_file(filename: "banner_red.erb", content: '') - create_test_file(filename: "banner_black.erb", content: '') - - Static.banner = NotificationFileLookup.new(location_of_test_files).banner - end - - should "not show a banner notification on the page" do - visit "/templates/wrapper.html.erb" - refute page.has_selector? "#banner-notification" - end - end - - context "given view files are present for a green notification" do - setup do - create_test_file(filename: "banner_green.erb", content: '

Everything is fine

') - create_test_file(filename: "banner_red.erb", content: '') - create_test_file(filename: "banner_black.erb", content: '') - - Static.banner = NotificationFileLookup.new(location_of_test_files).banner - end - - should "show a banner notification on the page" do - visit "/templates/wrapper.html.erb" - assert page.has_selector? "#banner-notification.green" - assert_match '

Everything is fine

', page.body - end - end - - context "given view files are present for a red notification" do - setup do - create_test_file(filename: "banner_green.erb", content: '') - create_test_file(filename: "banner_red.erb", content: '

Everything is not fine

') - create_test_file(filename: "banner_black.erb", content: '') - - Static.banner = NotificationFileLookup.new(location_of_test_files).banner - end - - should "show a banner notification on the page" do - visit "/templates/wrapper.html.erb" - assert page.has_selector? "#banner-notification.red" - assert_match '

Everything is not fine

', page.body - end - end - - context "given view files are present for a black notification" do - setup do - create_test_file(filename: "banner_green.erb", content: '') - create_test_file(filename: "banner_red.erb", content: '') - create_test_file(filename: "banner_black.erb", content: '

RIP John Doe

') - - Static.banner = NotificationFileLookup.new(location_of_test_files).banner - end - - should "show a banner notification on the page" do - visit "/templates/wrapper.html.erb" - assert page.has_selector? "#banner-notification.black" - assert_match '

RIP John Doe

', page.body - end - end - end end