I'm trying to do an end-to-end smoke test for a one page app, and stuck with the following:
The app just runs as a bunch of HTML pages, and has no server side code (I'm running Apache locally to serve the pages).
The API calls are to /api/blah and I currently have an alias in my httpd.conf that redirects the /api/blah call to the proper server API (www.example.com/api/blah).
The API has an SSO requirement, so I want to avoid calling the actual API during functional testing.
I've got cucumber setup locally, with watir-webdriver handling the browser control. I've got a few tests running with the intial state, but would love to mock out the calls to the API with some dummy JSON I have stored with the project.
The tests will be eventually run on a TeamCity CI server.
I tried using WebMock and FakeWeb, but they're looking for serverside calls - so the ajax calls from the app are never hitting something they can intercept.
I've also looked into maybe firing up the server with jsTestDriver, then mocking it out there, but can't get the two to connect.
Are there any solutions for this out there, or has anyone had this problem and solved it reliably?