Anyboby know why? I am waiting online!

On 3月10日, 上午10时16分, "James H." <[email protected]> wrote:
> Hello,
>
> I am using authlogic and rspec in our project. I steup the authlogic
> as the offical example. But when i run my rspec, it tells me that
> password field is not required. My spec file is as following:
>
> require 'spec_helper'
>
> describe User do
>   before(:each) do
>     @valid_attributes = {
>       :email => '[email protected]',
>       :password => "aaaaaa",
>       :password_confirmation => "aaaaaa"
>     }
>     @user = User.new(@valid_attributes)
>   end
>
> ......
>
>   it "should not be valid without a password" do
>     @user.password = nil
>     @user.should_not be_valid
>   end
> ........
> end
>
> the rspec show me "expected valid? to return false, got true".  but
> when I run the application in firefox, and if I leave the password
> field empty, the form will give errors. I also run irb: @user =
> User.new( :email => "[email protected]", :password =
> nil,  :password_confirmation = 'a' * 10), the @user.valid? returned
> false.
>
> Why the rspec got true?
> .

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to