diff --git a/spec/models/benefits_spec.rb b/spec/models/benefits_spec.rb new file mode 100644 index 0000000..f8ec369 --- /dev/null +++ b/spec/models/benefits_spec.rb @@ -0,0 +1 @@ +require 'spec_helper' diff --git a/spec/models/paid_time_off_spec.rb b/spec/models/paid_time_off_spec.rb new file mode 100644 index 0000000..2dba717 --- /dev/null +++ b/spec/models/paid_time_off_spec.rb @@ -0,0 +1,14 @@ +require 'spec_helper.rb' +=begin +describe "PaidTimeOff" do + user = User.new( + first_name: 'Tester', + last_name: 'MGee', + email: 'tester.mgee@gmail.com', + password: 'password', + password_confirmation: 'password' + ) + expect(user).to be_valid +end + +=end \ No newline at end of file diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb new file mode 100644 index 0000000..759d850 --- /dev/null +++ b/spec/models/user_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper.rb' + +describe User do + it "can be instantiated" do + User.new.should be_an_instance_of(User) + end + + it "should require a email" do + User.new(:email => "").should_not be_valid + end + + it "should require valid email" do + User.new(:email => "tester@gmail.com@gmail.com").should_not be_valid + end + + it "should require unique email" do + user = User.all.first + User.new(:email => user.email).should_not be_valid + end + + it "name can be updated" do + new_name = "Bobby" + user = User.all.first + user.first_name = new_name + user.save! + User.all.first.first_name.should == new_name + end +end \ No newline at end of file