1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00

Add documentation to validate_inclusion_of on qualifier

[ci skip]
This commit is contained in:
Mauro George 2015-03-28 11:48:31 -03:00 committed by Elliot Winkler
parent d31046d90c
commit 9a893f372d

View file

@ -67,6 +67,33 @@ module Shoulda
#
# #### Qualifiers
#
# Use `on` if your validation applies only under a certain context.
#
# class Issue
# include ActiveModel::Model
# attr_accessor :severity
#
# validates_inclusion_of :severity,
# in: %w(low medium high),
# on: :create
# end
#
# # RSpec
# describe Issue do
# it do
# should validate_inclusion_of(:severity).
# in_array(%w(low medium high)).
# on(:create)
# end
# end
#
# # Test::Unit
# class IssueTest < ActiveSupport::TestCase
# should validate_inclusion_of(:severity).
# in_array(%w(low medium high)).
# on(:create)
# end
#
# ##### with_message
#
# Use `with_message` if you are using a custom validation message.