[rspec-users] rspec assert inclusion in..

slavix mikerin.slava at gmail.com
Sat Sep 3 23:41:17 EDT 2011


this seems to be the way to do it.

    it
{ should_validate_numericality_of :amount, :greater_than_or_equal_to
=> 0 }
    it { should_validate_inclusion_of :gender, :in => %w( m f )

On Sep 3, 6:42 pm, Nick <n... at deadorange.com> wrote:
> Hey Slavix. How about this:
>
> it 'has a valid "attribute_x" value' do
>   valid_values = %w(some values here)
>   valid_values.should include subject.attribute_x
> end
>
> _______________________________________________
> rspec-users mailing list
> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users


More information about the rspec-users mailing list