including third party javascript API in Rails 3.1 works in server mode, but not when testing


I can use google maps api v3 in my Rails 3.1 app in development by
including the following in the layouts/application header:

<script src="[…my key
here…]&sensor=false&libraries=places" type="text/javascript"></

But when I integration test my app (capybara-webkit) I get a js error
associated with an object that the api should be initializing.

In the past I had tried to skirt this problem by just including in a
separate file the actual script generated by the src address from
above -- but the approach is not viable when you need to authenticate
to the third party api.

It seems to me this is a rails 3 issue, and not a test framework
specific issue. I figure anyone else who has integration-tested many
mashup apps using Rails will have met this problem. What did you do?