Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qa/spec
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2017-12-15 19:59:35 +0300
committerFelipe Artur <felipefac@gmail.com>2018-01-26 17:03:25 +0300
commit3a1e06d6a2494af5449abfee9fb49d56a0f3fe00 (patch)
treec80c0441eba26485bff647729c8bc1ca4e349e25 /qa/spec
parentaf95ba2fb481be62722438e5d93b074b1d3f89cb (diff)
Create merge request spec
Diffstat (limited to 'qa/spec')
-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