Class: Storexplore::Testing::DummyData

Inherits:
Object
  • Object
show all
Defined in:
lib/storexplore/testing/dummy_data.rb

Overview

Dummy data generator for Storexplore::Testing::DummyStore store generation

Class Method Summary collapse

Class Method Details

.attributes(name, options) ⇒ Object

A new unique set of standard store item attributes.



35
36
37
38
39
40
41
42
43
# File 'lib/storexplore/testing/dummy_data.rb', line 35

def self.attributes(name, options)
  {
    name: name,
    brand: brand(name),
    image: image(name),
    remote_id: remote_id,
    price: price(name)
  }.merge(options)
end

.name(kind) ⇒ Object

A new unique name.



30
31
32
# File 'lib/storexplore/testing/dummy_data.rb', line 30

def self.name(kind)
  "#{kind.capitalize}-#{new_int}"
end