Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
edds committed Feb 28, 2014
1 parent 4c4499a commit be4f6d3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions test/integration/templates/error_4xx_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 3 additions & 3 deletions test/integration/templates/error_5xx_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 3 additions & 3 deletions test/integration/templates/homepage_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
5 changes: 3 additions & 2 deletions test/integration/templates/wrapper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit be4f6d3

Please sign in to comment.