Fill out the have_one.through spec further
This commit is contained in:
parent
fbc4906d73
commit
e6045629e0
|
@ -1,5 +1,5 @@
|
|||
PATH
|
||||
remote: /Users/gabe/thoughtbot/open-source/shoulda-matchers
|
||||
remote: /home/mike/thoughtbot/shoulda-matchers
|
||||
specs:
|
||||
shoulda-matchers (1.2.0)
|
||||
activesupport (>= 3.0.0)
|
||||
|
@ -46,7 +46,7 @@ GEM
|
|||
bourne (1.1.2)
|
||||
mocha (= 0.10.5)
|
||||
builder (2.1.2)
|
||||
childprocess (0.3.2)
|
||||
childprocess (0.3.3)
|
||||
ffi (~> 1.0.6)
|
||||
cucumber (1.1.9)
|
||||
builder (>= 2.1.2)
|
||||
|
@ -68,7 +68,7 @@ GEM
|
|||
mime-types (~> 1.16)
|
||||
treetop (~> 1.4.8)
|
||||
metaclass (0.0.1)
|
||||
mime-types (1.18)
|
||||
mime-types (1.19)
|
||||
mocha (0.10.5)
|
||||
metaclass (~> 0.0.1)
|
||||
polyglot (0.3.3)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
PATH
|
||||
remote: /Users/gabe/thoughtbot/open-source/shoulda-matchers
|
||||
remote: /home/mike/thoughtbot/shoulda-matchers
|
||||
specs:
|
||||
shoulda-matchers (1.2.0)
|
||||
activesupport (>= 3.0.0)
|
||||
|
@ -47,7 +47,7 @@ GEM
|
|||
bourne (1.1.2)
|
||||
mocha (= 0.10.5)
|
||||
builder (3.0.0)
|
||||
childprocess (0.3.2)
|
||||
childprocess (0.3.3)
|
||||
ffi (~> 1.0.6)
|
||||
cucumber (1.1.9)
|
||||
builder (>= 2.1.2)
|
||||
|
@ -71,7 +71,7 @@ GEM
|
|||
mime-types (~> 1.16)
|
||||
treetop (~> 1.4.8)
|
||||
metaclass (0.0.1)
|
||||
mime-types (1.18)
|
||||
mime-types (1.19)
|
||||
mocha (0.10.5)
|
||||
metaclass (~> 0.0.1)
|
||||
multi_json (1.3.6)
|
||||
|
@ -116,7 +116,7 @@ GEM
|
|||
activesupport (>= 3.0)
|
||||
railties (>= 3.0)
|
||||
rspec (~> 2.8.0)
|
||||
sass (3.1.19)
|
||||
sass (3.1.20)
|
||||
sass-rails (3.1.6)
|
||||
actionpack (~> 3.1.0)
|
||||
railties (~> 3.1.0)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
PATH
|
||||
remote: /Users/gabe/thoughtbot/open-source/shoulda-matchers
|
||||
remote: /home/mike/thoughtbot/shoulda-matchers
|
||||
specs:
|
||||
shoulda-matchers (1.2.0)
|
||||
activesupport (>= 3.0.0)
|
||||
|
@ -46,7 +46,7 @@ GEM
|
|||
bourne (1.1.2)
|
||||
mocha (= 0.10.5)
|
||||
builder (3.0.0)
|
||||
childprocess (0.3.2)
|
||||
childprocess (0.3.3)
|
||||
ffi (~> 1.0.6)
|
||||
cucumber (1.1.9)
|
||||
builder (>= 2.1.2)
|
||||
|
@ -61,7 +61,7 @@ GEM
|
|||
json (>= 1.4.6)
|
||||
hike (1.2.1)
|
||||
i18n (0.6.0)
|
||||
journey (1.0.3)
|
||||
journey (1.0.4)
|
||||
jquery-rails (2.0.2)
|
||||
railties (>= 3.2.0, < 5.0)
|
||||
thor (~> 0.14)
|
||||
|
@ -71,7 +71,7 @@ GEM
|
|||
mime-types (~> 1.16)
|
||||
treetop (~> 1.4.8)
|
||||
metaclass (0.0.1)
|
||||
mime-types (1.18)
|
||||
mime-types (1.19)
|
||||
mocha (0.10.5)
|
||||
metaclass (~> 0.0.1)
|
||||
multi_json (1.3.6)
|
||||
|
@ -114,7 +114,7 @@ GEM
|
|||
activesupport (>= 3.0)
|
||||
railties (>= 3.0)
|
||||
rspec (~> 2.8.0)
|
||||
sass (3.1.19)
|
||||
sass (3.1.20)
|
||||
sass-rails (3.2.5)
|
||||
railties (~> 3.2.0)
|
||||
sass (>= 3.1.10)
|
||||
|
|
|
@ -444,7 +444,7 @@ describe Shoulda::Matchers::ActiveRecord::AssociationMatcher do
|
|||
end
|
||||
|
||||
it "should accept an association with a through" do
|
||||
define_model :history
|
||||
define_model :detail
|
||||
|
||||
define_model :account do
|
||||
has_one :detail
|
||||
|
@ -458,6 +458,16 @@ describe Shoulda::Matchers::ActiveRecord::AssociationMatcher do
|
|||
Person.new.should @matcher.through(:account)
|
||||
end
|
||||
|
||||
it "should reject an association with a through" do
|
||||
define_model :detail
|
||||
|
||||
define_model :person do
|
||||
has_one :detail
|
||||
end
|
||||
|
||||
Person.new.should_not @matcher.through(:account)
|
||||
end
|
||||
|
||||
context 'should accept an association with a false :validate option' do
|
||||
before do
|
||||
define_model :detail, :person_id => :integer, :disabled => :boolean
|
||||
|
|
Loading…
Reference in New Issue