Karle Durante
41c763d276
Using ActiveRecord::Base.connection is presumptuous. You must infer the home of the join table using the parent model. This allows developers to define HABTM relationships in other databases and still use the 'have_and_belong_to_many' matcher.
2012-09-21 11:40:39 -04:00
Daniel Tamiosso
e831348a05
Add a #validate check for association matchers
2012-07-09 14:51:45 +02:00
Gabe Berke-Williams
a718c46814
WIP: start to move to using an options hash.
2012-04-24 16:21:23 -05:00
Gabe Berke-Williams
5baa056f35
Bump rspec-rails.
2012-04-20 14:15:56 -04:00
Gabe Berke-Williams
3b3181b11a
Whitespace.
2012-03-25 21:49:36 -04:00
Gabe Berke-Williams
41bccc8cbf
Cleanup.
2012-03-23 19:50:08 -04:00
Mike Bloy
5c173bf1b7
test and bugfix for failing case
2012-03-22 21:28:57 -05:00
Mike Bloy
c863f7e6f0
association_matcher foreign_key refinement
...
https://github.com/thoughtbot/shoulda-matchers/issues/66
has_many and has_one tests failed with the reverse association has a
nonstandard name, (eg "belongs_to :author, :class_name => :User)
corrected by having have_one and have_many association tests check for an
:inverse_of on their association, and use the inverse relationship's
foreign key info if it can be found
2012-03-22 21:27:21 -05:00
Markus Schwed
17ac7d5a36
Added class_name option matcher to association_matcher
2011-10-16 14:06:24 +02:00
Håkon Lerring
0820901e4b
Added support for testing the :conditions option on associations
2011-09-23 13:19:17 +02:00
Prem Sichanugrist
a6fa83e18c
Fix whitespace
2011-09-12 17:25:05 +07:00
Oscar Del Ben
7e999d73a6
add order clause
2011-06-16 16:21:57 +02:00
Joel Moss
6b4035c117
Prefer #foreign_key to #primary_key_name when possible for AssociationMatcher#foreign_key
...
Fixes deprecation warning added in Rails 3.1:
https://github.com/rails/rails/blob/v3.1.0.beta1/activerecord/lib/active_record/reflection.rb#L201-208
Closes: https://github.com/thoughtbot/shoulda-matchers/pull/9
2011-05-20 10:22:08 -04:00
Joe Ferris
56b0a0439e
Move into the Matchers namespace
2010-12-15 17:34:19 -05:00