summaryrefslogtreecommitdiff
path: root/qa/qa/factory/product.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/factory/product.rb')
-rw-r--r--qa/qa/factory/product.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/qa/qa/factory/product.rb b/qa/qa/factory/product.rb
index dbe02d37f22..937bae7ac11 100644
--- a/qa/qa/factory/product.rb
+++ b/qa/qa/factory/product.rb
@@ -8,8 +8,7 @@ module QA
Attribute = Struct.new(:name, :block)
- def initialize(factory)
- @factory = factory
+ def initialize
@location = current_url
end
@@ -18,8 +17,8 @@ module QA
end
def self.populate!(factory)
- new(factory).tap do |product|
- factory.class.attributes.each_value do |attribute|
+ new.tap do |product|
+ factory.attributes.each_value do |attribute|
product.instance_exec(&attribute.block).tap do |value|
product.define_singleton_method(attribute.name) { value }
end