--
You received this message because you are subscribed to the Google Groups "webrat" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to webrat+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webrat?hl=en.
> I want to use Cucumber to test a remote, restful PHP app. I just want to send simple GET requests and one POST request (aka curl) for logging on. I don't really need to emulate a browser and navagate pages. I just want to check the HTTP status, save the session cookie, and parse the JSON that gets returned.
Someone on this list a few weeks ago mentioned using a combination of aruba (a gem containing cucumber step definitions for testing command-line applications) and curl. This would mean you'd end up with steps like this:
Given there is a widget with the following details:
| name | Matt |
| make | British |
When I run "curl http://mytestapp.com/widgets.php"
Then it should pass with:
"""
[{"name": "Matt", "make": "British"}]
"""
What do you think? Would that work for you?
>
> What is the easiest way to accomplish this for cucumber? Do I use Webrat, Mechanize, Selenium, some combination of them, or something else? I am reading the online docs, but not sure what each gem does that distinguishes it for my purposes.
>
> I used Cucumber to test a restful API on my own localhost with Rack-Test and it worked great, but this time I think the setup needs to be different and I'm not sure where to start.
>
> --
> You received this message because you are subscribed to the Google Groups "webrat" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to webrat+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/webrat?hl=en.
cheers,
Matt
I think you misunderstood what Larry needs. He needs to issue real
HTTP requests, not stub them out.
I'd try typhoeus or httparty
(http://ruby-toolbox.com/categories/http_clients.html)
It would be nice if someone wrote a REST abstraction API with various
pluggable drivers (rack-test and typhoeus/httparty). -Kind of like
Capybara, but without the DOM stuff - just focus on simple REST. Then
we could slap an aruba-like set of step defs around it.
Still nobody volunteering to create the restafarian gem for Cucumber?
Aslak