Specify rails 4 so it does not include rails 4.1 in Gemfile_rails40.
Merge branch 'fix_rails4_tests' into duplication_refactor