based on rspec_rails_4 branch