You can always define your API key requirements in an environment file. This way you could define different keys for different environments and postpone any production-related decisions for a later stage.
For example in your development.rb
you could have something like this:
config.my_api_key = "TESTING"
which would allow you to use an easy to remember value for your testing purposes.
When you test for the key validity you compare of course against the environment-specific key as in:
if params[:api_key] == Rails.configuration.my_api_key
# ...
You can have different keys for testing, development, staging, and so on.