summaryrefslogtreecommitdiff
path: root/qa/spec/factory
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2017-12-15 14:59:35 -0200
committerFelipe Artur <felipefac@gmail.com>2018-01-26 12:03:25 -0200
commit3a1e06d6a2494af5449abfee9fb49d56a0f3fe00 (patch)
treec80c0441eba26485bff647729c8bc1ca4e349e25 /qa/spec/factory
parentaf95ba2fb481be62722438e5d93b074b1d3f89cb (diff)
downloadgitlab-ce-3a1e06d6a2494af5449abfee9fb49d56a0f3fe00.tar.gz
Create merge request specqa_78_create_merge_request
Diffstat (limited to 'qa/spec/factory')
-rw-r--r--qa/spec/factory/dependency_spec.rb13
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