On 11/04/2010 09:50 PM, Mohammed Morsi wrote:
> ---
>   src/spec/models/user_spec.rb |   16 ++++++++++++++++
>   1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/src/spec/models/user_spec.rb b/src/spec/models/user_spec.rb
> index af88688..e7e69c7 100644
> --- a/src/spec/models/user_spec.rb
> +++ b/src/spec/models/user_spec.rb
> @@ -43,4 +43,20 @@ describe User do
>       user.should_not be_valid
>     end
>
> +  it "should not be valid if first name is too long" do
> +    u = Factory(:tuser)
> +    u.first_name = ('a' * 256)
> +    u.valid?.should be_false
> +    u.errors[:first_name].should_not be_nil
> +    u.errors[:first_name].should =~ /^is too long.*/
> +  end
> +
> +  it "should not be valid if last name is too long" do
> +    u = Factory(:tuser)
> +    u.last_name = ('a' * 256)
> +    u.valid?.should be_false
> +    u.errors[:last_name].should_not be_nil
> +    u.errors[:last_name].should =~ /^is too long.*/
> +  end
> +
>   end

ACK to both (rebase will be required because of conflict with tomas's patch)
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to