empirical-org/Empirical-Core — pull request #419 by chrisjeon (2014-10-18 03:13:09+00:00)
Title: #414

Requires First Name and Last Name for User Signup (including students) and adds accounts_controller_spec.rb

I made the students sign up field to require first name and last name as well, but this can easily be changed dynamically with JavaScript. I noticed that the Users table does not have a separate first_name and last_column but there are some methods in the User model that joins first_name and last_name into a single name column (which I thought was pretty cool).

I decided to and a "required: true" to the sign up forms rather than doing the validations in the controller because technically the User doesn't have a first_name last_name column and the validation can't be done with Rails. I mean, this technically "can" be done with a conditional in the accounts_controller but I thought that would just add extra logic in the controller. However, if this validation needs to be done on the back-end, I can make this change.

I also noticed that RSpec for some reason didn't pick up some changes I made to the accounts_controler_spec.rb. I'm guessing it's the configuration in spec_helper.rb, but couldn't figure out what was causing it (probably something to do with focus: true???)