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
|
include Mongoid::Document
|
||||||
|
|
||||||
field :password
|
field :password
|
||||||
|
field :name
|
||||||
|
|
||||||
|
|
||||||
|
validates :password, :presence => true
|
||||||
|
validates :name, :presence =>true
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,17 @@ require 'spec_helper'
|
||||||
|
|
||||||
describe 'a user should be able to log into his seed' do
|
describe 'a user should be able to log into his seed' do
|
||||||
before do
|
before do
|
||||||
User.all.each {|x| x.delete}
|
User.delete_all
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should should have a name and password' do
|
it 'should should have a name and password' do
|
||||||
User.count.should == 0
|
User.count.should == 0
|
||||||
billy = User.create
|
billy = User.new
|
||||||
User.count.should == 1
|
User.count.should == 0
|
||||||
|
billy.save
|
||||||
|
User.count.should == 0
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should be able to log into a page with a password' do
|
it 'should be able to log into a page with a password' do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue