Can I use RSpec to test deployed site?
rspec, ruby-on-rails, testing
Solution
Yes you can test deployed site using Rspec and Capybara. You need change configuration like this:
Change driver to `:webkit`, `:selenium` or `:poltergeist`, because the default driver (`:rack_test`) does not support running against a remote server.
Capybara.javascript_driver = :selenium
Set app_host.
Capybara.app_host = 'http://example.com'
Turn off local server.
Capybara.run_server = false
After that you can create test for deployed server using Capybara DSL.
Problem
I should say first, that I'm not very well-versed in testing my code, and I didn't do it at all until recently. So I have this rails app. It's basically an API endpoint. It takes requests and spits JSON. There's good (I hope) test coverage that should test most of the functionality. Now we're deploying a staging env and want to let load testing guys (independent department) to "play" with it. I want to be super sure that we deployed it correctly. Can I run RSpec's request specs against this staging deployment? Do people do this kind of testing at all? What are best practices? What should I read?