Recently I used Rspec to implement Test Driven Development(TDD) approach for developing an existing rails application. After setting up test environment it was time to migrate data from development database to test database in order to test some controller actions.
There are some neat ways to use 'factories' or 'fixtures' but that wasn't right choice due to size factor.
Taking dump of database and restoring into test db, well that's quick and easy solution but I didn't want data of all tables.
I was searching for a better solution and I found one. I used rails console to migrate data from development environment to test environment.
Here's what rails guide has to say about rails console:
The console command lets you interact with your Rails application from the command line. On the underside, rails console uses IRB, so if you've ever used it, you'll be right at home. This is useful for testing out quick ideas with code and changing data server-side without touching the website.
Git is widely used version control system for managing source code and enhance collaboration.
Most important thing to take care while working with git is that you must be aware of branch you are working on, so that you don't accidentally make changes in wrong branch of your repository. This tricky in terminal as it doesn't show git branch name.
We can customize terminal in such a way that it shows current branch name of repository you are working on and reduces chances of making changes to wrong branch to great extent.
Here is how to do that:
Open bashrc file.