Sha256: cb52e84fa8b23ce7ac2804810ade5776f9e67836d98ade6466805e70d4a88dc9

Contents?: true

Size: 1.44 KB

Versions: 2

Compression:

Stored size: 1.44 KB

Contents

shared_examples 'Unidom::ArticleNumber::Concerns::AsMarked' do |model_attributes|

  marking_1_attribtues = {
      marker_id:    SecureRandom.uuid,
      marker_type:  'Unidom::ArticleNumber::Marker::Mock'
    }

  marking_2_attribtues = {
      marker_id:    SecureRandom.uuid,
      marker_type:  'Unidom::ArticleNumber::Marker::Mock'
    }

  marking_1_attribtues[:barcode] = Unidom::ArticleNumber::Ean13Barcode.coded_as('1234567899527').first_or_create!
  marking_1_attribtues[:barcode] = Unidom::ArticleNumber::Ean13Barcode.coded_as('1234567899526').first_or_create!
  it_behaves_like 'has_many', model_attributes, :markings, Unidom::ArticleNumber::Marking, [ marking_1_attribtues, marking_2_attribtues ]

  marking_1_attribtues[:barcode] = Unidom::ArticleNumber::Ean8Barcode.coded_as('95279527').first_or_create!
  marking_1_attribtues[:barcode] = Unidom::ArticleNumber::Ean8Barcode.coded_as('95269526').first_or_create!
  it_behaves_like 'has_many', model_attributes, :markings, Unidom::ArticleNumber::Marking, [ marking_1_attribtues, marking_2_attribtues ]

  #marking_1_attribtues[:barcode] = Unidom::ArticleNumber::VehicleIdentificationNumber.coded_as('LVHCU165XD5002138').first_or_create!
  #marking_1_attribtues[:barcode] = Unidom::ArticleNumber::VehicleIdentificationNumber.coded_as('LFVAA11A6X2075355').first_or_create!
  #it_behaves_like 'has_many', model_attributes, :markings, Unidom::ArticleNumber::Marking, [ marking_1_attribtues, marking_2_attribtues ]

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unidom-article_number-3.0.1 lib/rspec/models/unidom/article_number/concerns/as_marked_shared_examples.rb
unidom-article_number-3.0 lib/rspec/models/unidom/article_number/concerns/as_marked_shared_examples.rb