Add doc to join_table qualifier on have_and_belong_to_many matcher
[ci skip]
This commit is contained in:
parent
721900b8fd
commit
b4012404d9
|
@ -774,6 +774,29 @@ module Shoulda
|
||||||
# class_name('City')
|
# class_name('City')
|
||||||
# end
|
# 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
|
# ##### validate
|
||||||
#
|
#
|
||||||
# Use `validate` to test that the `:validate` option was specified.
|
# Use `validate` to test that the `:validate` option was specified.
|
||||||
|
|
Loading…
Reference in New Issue