push for rafi
This commit is contained in:
parent
e068707158
commit
8b0c3725a5
2 changed files with 13 additions and 3 deletions
|
|
@ -2,4 +2,10 @@ class User
|
|||
include Mongoid::Document
|
||||
|
||||
field :password
|
||||
field :name
|
||||
|
||||
|
||||
validates :password, :presence => true
|
||||
validates :name, :presence =>true
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,13 +2,17 @@ require 'spec_helper'
|
|||
|
||||
describe 'a user should be able to log into his seed' do
|
||||
before do
|
||||
User.all.each {|x| x.delete}
|
||||
User.delete_all
|
||||
end
|
||||
|
||||
it 'should should have a name and password' do
|
||||
User.count.should == 0
|
||||
billy = User.create
|
||||
User.count.should == 1
|
||||
billy = User.new
|
||||
User.count.should == 0
|
||||
billy.save
|
||||
User.count.should == 0
|
||||
|
||||
|
||||
end
|
||||
|
||||
it 'should be able to log into a page with a password' do
|
||||
|
|
|
|||
Loading…
Reference in a new issue