Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PhantomJS test behaviour on Linux (#1457)
Currently, several acceptance specs fail on Debian. The errors suggest that some pages don't have some expected content, and while the specs are running we get a mysterious message that looks like this: ``` Not allowed to load local resource: file:///admin/log_entries/1 ``` The culprit is the JS that makes table rows clickable. They extract the `href` from the link cell and apply it to `window.location`. Normally this works: it's a path URL (eg: `/admin/log_entries/1`) and the result preserves the current scheme+host (eg: if we were at `http://localhost:12345/admin/products`, we'll end up with `http://localhost:12345/admin_log_entries/1`). Unfortunately, the behaviour on PhantomJS under Debian Stretch is different. In this case, the scheme+host are lost, and we end up with a `file://` URL, and therefore with `file:///admin/log_entries/1`. As a result, links are not followed through, and therefore we don't move on to the next page, and specs fail to find the expected content. Assigning the URI to `window.location.pathname` instead solves the problem.
- Loading branch information