diff options
author | Felipe Artur <felipefac@gmail.com> | 2017-12-15 19:59:35 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2018-01-26 17:03:25 +0300 |
commit | 3a1e06d6a2494af5449abfee9fb49d56a0f3fe00 (patch) | |
tree | c80c0441eba26485bff647729c8bc1ca4e349e25 /qa/spec | |
parent | af95ba2fb481be62722438e5d93b074b1d3f89cb (diff) |
Create merge request spec
Diffstat (limited to 'qa/spec')
-rw-r--r-- | qa/spec/factory/dependency_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/qa/spec/factory/dependency_spec.rb b/qa/spec/factory/dependency_spec.rb index 32405415126..8aaa6665a18 100644 --- a/qa/spec/factory/dependency_spec.rb +++ b/qa/spec/factory/dependency_spec.rb @@ -54,6 +54,19 @@ describe QA::Factory::Dependency do expect(factory).to have_received(:mydep=).with(dependency) end + + context 'when receives a caller factory as block argument' do + let(:dependency) { QA::Factory::Base } + + it 'calls given block with dependency factory and caller factory' do + allow_any_instance_of(QA::Factory::Base).to receive(:fabricate!).and_return(factory) + allow(QA::Factory::Product).to receive(:populate!).and_return(spy('any')) + + subject.build! + + expect(block).to have_received(:call).with(an_instance_of(QA::Factory::Base), factory) + end + end end end end |