ActiveSupport provides present? and its complement blank? on all objects
(including nil) to save you needing the nil check.
On May 2, 2013 3:21 AM, "Subhas Dandapani" <notifications@github.com> wrote:

> In app/models/form_section.rb:
>
> > @@ -194,7 +194,7 @@ def validate_unique_id
> >    end
> >
> >    def validate_unique_name
> > -    unique = FormSection.all.all? {|f| id == f.id || name != nil && name != f.name }
> > +    unique = FormSection.all.all? {|f| id == f.id || name.empty? || name!= f.name }
>
> Although this is correct, two unit tests are failing because of this:
>
>
> http://ec2-54-224-119-2.compute-1.amazonaws.com:8111/viewLog.html?buildId=60&buildTypeId=bt12&tab=buildResultsDiv
>
> name.empty? throws an error when name is nil. So can u rather check for
> both nil? && empty?
>
> Once this is fixed - RSpec will pass, but afterwards cucumber tests will
> run, and we need to see if there is any other error.
>
> You can also run:
> bundle exec rake spec
> bundle exec rake cucumber:all
> In your local machine to run these same tests.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/rapidftr/RapidFTR/pull/490/files#r4050898>
> .
>