Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write and use refresh helper method to test AJAX-functionality #89

Open
eliotsykes opened this issue Sep 15, 2015 · 0 comments
Open

Write and use refresh helper method to test AJAX-functionality #89

eliotsykes opened this issue Sep 15, 2015 · 0 comments

Comments

@eliotsykes
Copy link
Owner

Used this refresh method on a project to ensure the page was always refreshed (IIRC, when the URL had a fragment identifier, e.g. http://localhost:3000/#/products, the refresh wouldn't work when it was a visit current_url, the refreshEnforcer random param was needed):

  def refresh
    url = URI.parse(current_url)
    if url.query.blank?
      url.query = ""
    else
      url.query << "&"
    end
    url.query << "refreshEnforcer=#{rand}"
    visit url.to_s
  end

Introduce this to rspec-rails-examples to test that an AJAX-dependent change has persisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant