thoughtbot/shoulda-matchers — pull request #556 by jacobsimeon (2014-07-23 23:43:55+00:00)
Title: Add support for HBTM `:join_table` option

In reference to Issue #547.

After renaming the method and adding tests for both the acceptance and rejection cases, I realized that the `AssocationMatcher` was already aware of any custom `:join_table` option that might have been passed to the association declaration.

So all I've done is add this method to `AssociationMatcher`:
``` ruby
def join_table(join_table_name)
self
end
```

This was enough to make the tests pass, although it kinda feels like lying to the user. I see a few options:

1. Don't bother with adding and explicit `join_table` method to `AssociationMatcher` since it could potentially mislead users and the join table's existence will always be tested correctly.
2. Keep the `join_table` method since it adds parity with ActiveRecord's API and gives a signal to users (and their coworkers) that a custom join table is being used for the association.
3. Go forward with more explicit support for the `:join_table` option, similar to what is already being done for the `:foreign_key` option.

What do you think?