Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
Merge pull request #204 from alphagov/clear-page-cache-before-tests
Browse files Browse the repository at this point in the history
Update to clear page cache before each test run
  • Loading branch information
RyanMacG authored Feb 21, 2018
2 parents 3db2a20 + f30c077 commit 7303236
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
=end

config.add_setting :reload_page_wait_time, default: 60

config.before(:each) do
page.driver.clear_memory_cache
end
end

Capybara.configure do |config|
Expand Down
2 changes: 1 addition & 1 deletion spec/whitehall/publishing_document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def then_i_can_view_it_on_gov_uk
def and_it_is_displayed_on_the_publication_finder
publication_finder = find('a', text: "Publications", match: :first)[:href]
reload_url_until_match(publication_finder, :has_text?, title)
click_link("Publications", match: :first)
visit(publication_finder)

expect_rendering_application("whitehall")
expect(page).to have_content(title)
Expand Down
2 changes: 1 addition & 1 deletion spec/whitehall/updating_document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def then_i_can_view_the_updated_content_on_gov_uk
def and_it_is_updated_on_the_publication_finder
publication_finder = find('a', text: "Publications", match: :first)[:href]
reload_url_until_match(publication_finder, :has_text?, updated_title)
click_link("Publications", match: :first)
visit(publication_finder)

expect_rendering_application("whitehall")
expect(page).to have_content(updated_title)
Expand Down

0 comments on commit 7303236

Please sign in to comment.