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.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/qa/qa/factory/product.rb b/qa/qa/factory/product.rb
new file mode 100644
index 00000000000..df35bbbb443
--- /dev/null
+++ b/qa/qa/factory/product.rb
@@ -0,0 +1,26 @@
+require 'capybara/dsl'
+
+module QA
+ module Factory
+ class Product
+ include Capybara::DSL
+
+ def initialize(factory)
+ @factory = factory
+ @location = current_url
+ end
+
+ def visit!
+ visit @location
+ end
+
+ def self.populate!(factory)
+ raise ArgumentError unless block_given?
+
+ yield factory
+
+ new(factory)
+ end
+ end
+ end
+end