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

Update to clear page cache before each test run #204

Merged
merged 1 commit into from
Feb 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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