Anyboby know why? I am waiting online!
On 3月10日, 上午10时16分, "James H."
<tcs...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
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 =>
''tcs...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org'',
> :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 => "g...-wvU4uTqWWAI@public.gmane.org", :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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.