jnicklas/capybara — pull request #958 by sdhull (2013-02-09 10:48:09+00:00)
Title: Adding asset server support

### Asset Server Support!

This adds asset server support to `save_and_open_page`

This takes the super-simple approach of prepending `Capybara.asset_server` to asset `src`'s or `href`'s (in the case of links). It may be simple, but it should be sufficient to get people's pages rendering with assets loading from other server locations (making no assumptions about where that server might be running).

So, for instance, if your assets were rendering in `save_and_open_page` like this:
```html

```

Then you could add this line to `spec_helper.rb`:
```ruby
Capybara.asset_server = "http://localhost:3000"
```
(please note, no trailing slash)

And then in your opened page from `save_and_open_page`, that same asset would be rendered as:
```html

```

If you don't wish to accept as-is, please tell me what I can do to make it acceptable or if there are some untenable issues that prevent acceptance.

Thank you!