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

Improved support for referrer and URL anchor testing. #7

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

georgebrock
Copy link

Hi Martin,

I've added a few bits to Holy Grail to help testing scripts that read either the referrer or the URL anchor:

  1. Ability to fake a referrer – if the referrer request header is set in the test (@request.env['HTTP_REFERER']) it will also be set on the Harmony page's document.

  2. Ability to set an anchor in the URL – if the request in the test includes an anchor (e.g. get :foo, :anchor => 'bar' ) then this will be set on the URL given to Harmony so it can be read by the JavaScript.

  3. Better compatibility with TextMate – just a minor change to disable redgreen when running the tests within TextMate.

I think they're useful extensions, but feel free to pick and choose what you think fits into the project.

George

In Ruby:
  get :foo, :anchor => 'bar'

In JavaScript:
  window.location.hash === '#bar'
Tempfiles are deleted when they are garbage
collected, so constructing the Harmony::Page from
a Tempfile with zero references can cause errors.

Now we build the page in the Tempfile's block to
avoid any unfortunate problems.
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

Successfully merging this pull request may close these issues.

1 participant