require 'spec_helper'
describe User do
before(:each) do
@attr = {
:username => "User",
:email => "aaaaer@example.com",
:password => "foobar",
:password_confirmation => "foobar",
:phone_no => "0808322222"
}
end
it "should create a new instance given a valid attribute" do
User.create!(@attr)
end
end
Тест не пройден, не знаю, почему
Failures:
1) User should create a new instance given a valid attribute
Failure/Error: User.create!(@attr)
Mongoid::Errors::Validations:
Validation failed - Phone no can't be blank, Username can't be blank.
# ./spec/models/user_spec.rb:16:in `block (2 levels) in <top (required)>'
Finished in 0.2505 seconds
2 examples, 1 failure