Hi Brian,
I'm not sure I understood correctly but I assume you want to 'mock' twitter to make a callback to your controller, right?
You could "simulate" twitter making a request to your server, by evaluating the response in WebMock declared as a block i.e.
).to_return { |req|
Net::HTTP.get(URI.parse(url_for( :controller => 'twitter', :action =>
'complete', :code => 'abcdefghi' )))
{}
})
This will make a request to twitter controller before returning a response.
This can work if your app is running on localhost and you set WebMock.disable_net_connect!(:allow_localhost => true). Otherwise webmock will intercept the request to your controller.
The code which executes the request to twitter needs to run in a
separate process or thread than the twitter controller runs, otherwise the
server thread with will be blocked (making a request to
twitter) and won't be able to handle twitter controller action.
Bartosz