From b4012404d9cea02ed03dc0890afc95ede88c44a6 Mon Sep 17 00:00:00 2001 From: Mauro George Date: Tue, 21 Apr 2015 11:04:01 -0300 Subject: [PATCH] Add doc to join_table qualifier on have_and_belong_to_many matcher [ci skip] --- .../active_record/association_matcher.rb | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/shoulda/matchers/active_record/association_matcher.rb b/lib/shoulda/matchers/active_record/association_matcher.rb index 440726fb..aaf1d529 100644 --- a/lib/shoulda/matchers/active_record/association_matcher.rb +++ b/lib/shoulda/matchers/active_record/association_matcher.rb @@ -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.