Add doc to join_table qualifier on have_and_belong_to_many matcher

[ci skip]
This commit is contained in:
Mauro George 2015-04-21 11:04:01 -03:00 committed by Elliot Winkler
parent 721900b8fd
commit b4012404d9
1 changed files with 23 additions and 0 deletions

View File

@ -774,6 +774,29 @@ module Shoulda
# class_name('City')
# end
#
# ##### join_table
#
# Use `join_table` to test usage of the `:join_table` option. This
# asserts that the table you're referring to actually exists.
#
# class Person < ActiveRecord::Base
# has_and_belongs_to_many :issues, join_table: 'people_tickets'
# end
#
# # RSpec
# describe Person do
# it do
# should have_and_belong_to_many(:issues).
# join_table('people_tickets')
# end
# end
#
# # Test::Unit
# class PersonTest < ActiveSupport::TestCase
# should have_and_belong_to_many(:issues).
# join_table('people_tickets')
# end
#
# ##### validate
#
# Use `validate` to test that the `:validate` option was specified.