On 09/08/2011, at 7:12 PM, Tomas Hrcka wrote:
1.) We have tests that use the "response" object, such as to check whether we get JSON or a partial back. This isn't really supported in Capybara, and looking into it, it was pointed out that tests for response type probably don't belong in Cucumber in the first place. I'm not sure whether we want to throw them away or try to port to RSpec or something else. Some are weird, in that we practically duplicate tests -- once 'normally' for HTML, and then a second time by setting an Accept header to request JSON or a partial. (Some of these are my doing.) It probably doesn't make sense to do that if we just want to check that, when we request JSON, we get JSON back.
For this kind of tests i suggest using rspec request specs, for what I know it is lot faster then cucumber.
http://relishapp.com/rspec/rspec-rails/v/2-6/dir/request-specs/request-spec
Nice example of using rspec with capybara is also on railscasts
http://asciicasts.com/episodes/257-request-specs-and-capybara
Perhaps even a simple controller spec would suffice?