I have the following validation in my ActiveRecord.
validates :active, :inclusion => {:in => [\'Y\', \'N\']}
I am using the following to
In recent versions of shoulda-matchers
(at least as of v2.7.0), you can do:
expect(subject).to validate_inclusion_of(:active).in_array(%w[Y N])
This tests that the array of acceptable values in the validation exactly matches this spec.
In earlier versions, >= v1.4 , shoulda_matchers
supports this syntax:
it {should ensure_inclusion_of(:active).in_array(%w[Y N]) }