How to create a Rack app and test it using a headless Capybara.
This application shows a welcome page and change its title, throught JavaScript.
Download project:
git clone
cd rack_test_by_capybara
bundle install
To see it working:
rackup # See it at http://localhost:9292
To see the tests running:
rake test # Or, just rake, since test is the default task.
OSX
$ brew install phantomjs
- Config a rake task to test a Rack app
- Create firts test for 200 with a h1 saying "It works!"
- Create a rack app which answer 200, "It works!"
- Create test for 404 when acessing any other path
- Change RackApp to answer 404 when not accessing "/"
- Create a test to check greeting message on "/welcome"
- Add Rack server pages to show pages based on url
- Create a test to check JavaScript's greeting message, using Poltergeist
- Add JavaScript greeting message
- Run it on Travis