From be4f6d36f1cc7daf3a67931e1d1e20a9748382d8 Mon Sep 17 00:00:00 2001 From: Edd Sowden Date: Fri, 28 Feb 2014 09:42:23 +0000 Subject: [PATCH] Fix failing test We shouldn't care where the scripts are on the page only that they are there. This removes the check that they are in a specific part of the page. --- test/integration/templates/error_4xx_test.rb | 6 +++--- test/integration/templates/error_5xx_test.rb | 6 +++--- test/integration/templates/homepage_test.rb | 6 +++--- test/integration/templates/wrapper_test.rb | 5 +++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/test/integration/templates/error_4xx_test.rb b/test/integration/templates/error_4xx_test.rb index 4130205d0..4d41d9f14 100644 --- a/test/integration/templates/error_4xx_test.rb +++ b/test/integration/templates/error_4xx_test.rb @@ -10,9 +10,6 @@ class Error4XXTest < ActionDispatch::IntegrationTest assert page.has_selector?("title", :text => "Page not found - 404 - GOV.UK", :visible => :all) assert page.has_selector?("link[href='/static/application.css']", :visible => :all) - - assert page.has_selector?("script[src='/static/libs/jquery/jquery-1.7.2.js']", :visible => :all) - assert page.has_selector?("script[src='/static/application.js']", :visible => :all) end within "body.mainstream.error" do @@ -37,5 +34,8 @@ class Error4XXTest < ActionDispatch::IntegrationTest end end + + assert page.has_selector?("script[src='/static/libs/jquery/jquery-1.7.2.js']", :visible => :all) + assert page.has_selector?("script[src='/static/application.js']", :visible => :all) end end diff --git a/test/integration/templates/error_5xx_test.rb b/test/integration/templates/error_5xx_test.rb index 48b7c6668..edd63237e 100644 --- a/test/integration/templates/error_5xx_test.rb +++ b/test/integration/templates/error_5xx_test.rb @@ -10,9 +10,6 @@ class Error5XXTest < ActionDispatch::IntegrationTest assert page.has_selector?("title", :text => "Sorry, we are experiencing technical difficulties (500 error) - GOV.UK", :visible => :all) assert page.has_selector?("link[href='/static/application.css']", :visible => :all) - - assert page.has_selector?("script[src='/static/libs/jquery/jquery-1.7.2.js']", :visible => :all) - assert page.has_selector?("script[src='/static/application.js']", :visible => :all) end within "body.mainstream.error" do @@ -35,5 +32,8 @@ class Error5XXTest < ActionDispatch::IntegrationTest end end + + assert page.has_selector?("script[src='/static/libs/jquery/jquery-1.7.2.js']", :visible => :all) + assert page.has_selector?("script[src='/static/application.js']", :visible => :all) end end diff --git a/test/integration/templates/homepage_test.rb b/test/integration/templates/homepage_test.rb index ae196a072..6961ad55f 100644 --- a/test/integration/templates/homepage_test.rb +++ b/test/integration/templates/homepage_test.rb @@ -9,9 +9,6 @@ class HomepageTest < ActionDispatch::IntegrationTest assert page.has_selector?("title", :text => "GOV.UK - The best place to find government services and information", :visible => :all) assert page.has_selector?("link[href='/static/application.css']", :visible => :all) - - assert page.has_selector?("script[src='/static/libs/jquery/jquery-1.7.2.js']", :visible => :all) - assert page.has_selector?("script[src='/static/application.js']", :visible => :all) end within "body" do @@ -31,5 +28,8 @@ class HomepageTest < ActionDispatch::IntegrationTest assert page.has_selector?(".footer-meta") end end + + assert page.has_selector?("script[src='/static/libs/jquery/jquery-1.7.2.js']", :visible => :all) + assert page.has_selector?("script[src='/static/application.js']", :visible => :all) end end diff --git a/test/integration/templates/wrapper_test.rb b/test/integration/templates/wrapper_test.rb index 234928140..fb9eb23de 100644 --- a/test/integration/templates/wrapper_test.rb +++ b/test/integration/templates/wrapper_test.rb @@ -10,8 +10,6 @@ class WrapperTest < ActionDispatch::IntegrationTest assert page.has_selector?("link[href='/static/application.css']", :visible => :all) - assert page.has_selector?("script[src='/static/libs/jquery/jquery-1.7.2.js']", :visible => :all) - assert page.has_selector?("script[src='/static/application.js']", :visible => :all) end within "body" do @@ -32,5 +30,8 @@ class WrapperTest < ActionDispatch::IntegrationTest end end + + assert page.has_selector?("script[src='/static/libs/jquery/jquery-1.7.2.js']", :visible => :all) + assert page.has_selector?("script[src='/static/application.js']", :visible => :all) end end