I'm writting a rails application by TDD, So, I was wondering, how do I test production app, like having a different security token from development security token, how to ensure that all the configurations are correct in production, like mail configs etc.
Shouldn't we never run tests in production mode, since it would wipe the database.
So, how should one go about testing a rails app in production
The method many developers use is creating another environment called stage. You can make your configuration identical to production, and deploy to this before production to ensure everything works correctly. You can run your integration tests / performance tests against staging if you like.
You can copy the production config (config/environments/production.rb) to a new file called stage.rb, then remember to populate your database.yml with the new connection details for a stage database.