Skip to content

Commit

Permalink
Merge pull request DavyJonesLocker#49 from dockyard/MD-update_readme_…
Browse files Browse the repository at this point in the history
…about_test_host

Updates README with information about specifying test host.
  • Loading branch information
bcardarella committed Sep 23, 2014
2 parents 238d7d7 + 003fbfe commit eeb9286
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Expand Up @@ -163,6 +163,28 @@ The `current_email` method will delegate all necessary method calls to
current_email.subject`
```

## Setting your test host
When testing, it's common to want to open an email and click through to your
application. To do this, you'll probably need to update your test
environment, as well as Capybara's configuration.
By default, Capybara's `app_host` is set to
`http://example.com.` You should update this so that it points to the
same host as your test environment. In our example, we'll update both to
`http://localhost/3001`:
```ruby
# tests/test_helper.rb
ActionDispatch::IntegrationTest
Capybara.server_port = 3001
Capybara.app_host = 'http://localhost/3001'
end
# config/environments/test.rb
config.action_mailer.default_url_options = { host: 'localhost', port:
3000 }
```
Check out API for the `mail` gem for details on what methods are
available.
Expand Down

0 comments on commit eeb9286

Please sign in to comment.