Commit 3e766a823a144f7e8c799169696e4ac87c68db10
Committed by
Rafael Manzo
1 parent
88ba8e20
Exists in
colab
and in
4 other branches
User model
Showing
6 changed files
with
44 additions
and
1 deletions
Show diff stats
.gitignore
db/schema.rb
... | ... | @@ -11,6 +11,13 @@ |
11 | 11 | # |
12 | 12 | # It's strongly recommended that you check this file into your version control system. |
13 | 13 | |
14 | -ActiveRecord::Schema.define(version: 0) do | |
14 | +ActiveRecord::Schema.define(version: 20130627170417) do | |
15 | + | |
16 | + create_table "users", force: true do |t| | |
17 | + t.string "name" | |
18 | + t.string "email" | |
19 | + t.datetime "created_at" | |
20 | + t.datetime "updated_at" | |
21 | + end | |
15 | 22 | |
16 | 23 | end | ... | ... |
... | ... | @@ -0,0 +1,11 @@ |
1 | +require 'spec_helper' | |
2 | + | |
3 | +describe User do | |
4 | + context 'validations' do | |
5 | + subject { FactoryGirl.build(:user) } | |
6 | + | |
7 | + it { should validate_presence_of(:name) } | |
8 | + it { should validate_presence_of(:email) } | |
9 | + it { should validate_uniqueness_of(:email) } | |
10 | + end | |
11 | +end | ... | ... |