Have a web service which needs requires authentication, but you’re testing a completely different part of the application? Again, FakeWeb & Regex help you out here. If you’re testing a model extended from ActiveResource by using FakeWeb, the url will look something like this: 1http://user:pass@example.com/someService To mock the request, use a regular expression like so: [...]
Posted in:
Coding
by
damon
/
Tags: fakeweb, rspec, ruby, testing
Comments Off
I’ve been using a lot of FakeWeb + Rspec for creating ActiveResource models BDD-style without hitting my RESTful source. I keep on figuring out little things with FakeWeb that I feel like I should share. When you register uri’s with FakeWeb, and you’re using regular expressions, you might be building layers of access like this: [...]
Posted in:
Coding
by
damon
/
Tags: fakeweb, ruby, testing
1 Comment
In my effort to be a better BDD/TDD (Behavior-Driven and Test-Driven Development) Developer, I’ve been diving into writing apps using RSpec for testing. The nature of my work has me writing test where, in a non-automated-test environment, I would be using web services (SOAP and/or REST) to get and post data. Now, obviously I don’t [...]
Posted in:
Coding
by
damon
/
Tags: fakeweb, ruby, testing
Comments Off