unidom-article_number 2.3.5 → 2.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f230184a9348c0a6540ff87054d0e237210f44a9
4
- data.tar.gz: 1680b0164bcdf2569392dcac358db9c414c47092
3
+ metadata.gz: 74103cd6a92bbb282cfcf21b4afe9c7af05fb222
4
+ data.tar.gz: 3242e70644755303d151dcd13f74f6fc57d208a6
5
5
  SHA512:
6
- metadata.gz: 1ec8c735447b02c849a1b36479b895861ad88fd01e0f582df8e3586c455a7306c4b9f6eba335c53d454dc4204fa9758a204bc3caeabb1ea17784bc4064b7dac7
7
- data.tar.gz: 34161d493bbf609110bcab81f9184b55bbaea889adc5294c141abec00a853f90eb27a6bc99523cd387893121ac9bc49a361e6d5466ccdeef61f219b1e41dac6e
6
+ metadata.gz: 4f76fa1454c4d69591d9c0b53b54d7084f00b4b484c4413045287a277f497db142b9e77d2a16b4fe8f160f7aafd58716e323871a01651b20183aa98e25551a51
7
+ data.tar.gz: 9158fcf17ced6e26a6cdfeb4eba8522dac6fead3c07be715107e4413e5bfb15dd3f89290cf98ceca0966900a56c787a582c0d825be48c693b1ccd6f06c342f83
@@ -19,20 +19,7 @@ describe Unidom::ArticleNumber::Marking, type: :model do
19
19
 
20
20
  it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
21
21
 
22
- it_behaves_like 'scope', :barcode_is, [
23
- { attributes_collection: [ model_attributes ], count_diff: 0, args: [ Unidom::ArticleNumber::Ean13Barcode.new( id: model_attributes[:barcode_id]) ] },
24
- { attributes_collection: [ model_attributes ], count_diff: 0, args: [ Unidom::ArticleNumber::Ean8Barcode.new( id: model_attributes[:barcode_id]) ] },
25
- { attributes_collection: [ model_attributes ], count_diff: 0, args: [ Unidom::ArticleNumber::VehicleIdentificationNumber.new(id: model_attributes[:barcode_id]) ] },
26
- { attributes_collection: [ model_attributes.merge(barcode_type: 'Unidom::ArticleNumber::Ean13Barcode' ) ], count_diff: 1, args: [ Unidom::ArticleNumber::Ean13Barcode.new( id: model_attributes[:barcode_id]) ] },
27
- { attributes_collection: [ model_attributes.merge(barcode_type: 'Unidom::ArticleNumber::Ean13Barcode' ) ], count_diff: 0, args: [ Unidom::ArticleNumber::Ean8Barcode.new( id: model_attributes[:barcode_id]) ] },
28
- { attributes_collection: [ model_attributes.merge(barcode_type: 'Unidom::ArticleNumber::Ean13Barcode' ) ], count_diff: 0, args: [ Unidom::ArticleNumber::VehicleIdentificationNumber.new(id: model_attributes[:barcode_id]) ] },
29
- { attributes_collection: [ model_attributes.merge(barcode_type: 'Unidom::ArticleNumber::Ean8Barcode' ) ], count_diff: 0, args: [ Unidom::ArticleNumber::Ean13Barcode.new( id: model_attributes[:barcode_id]) ] },
30
- { attributes_collection: [ model_attributes.merge(barcode_type: 'Unidom::ArticleNumber::Ean8Barcode' ) ], count_diff: 1, args: [ Unidom::ArticleNumber::Ean8Barcode.new( id: model_attributes[:barcode_id]) ] },
31
- { attributes_collection: [ model_attributes.merge(barcode_type: 'Unidom::ArticleNumber::Ean8Barcode' ) ], count_diff: 0, args: [ Unidom::ArticleNumber::VehicleIdentificationNumber.new(id: model_attributes[:barcode_id]) ] },
32
- { attributes_collection: [ model_attributes.merge(barcode_type: 'Unidom::ArticleNumber::VehicleIdentificationNumber') ], count_diff: 0, args: [ Unidom::ArticleNumber::Ean13Barcode.new( id: model_attributes[:barcode_id]) ] },
33
- { attributes_collection: [ model_attributes.merge(barcode_type: 'Unidom::ArticleNumber::VehicleIdentificationNumber') ], count_diff: 0, args: [ Unidom::ArticleNumber::Ean8Barcode.new( id: model_attributes[:barcode_id]) ] },
34
- { attributes_collection: [ model_attributes.merge(barcode_type: 'Unidom::ArticleNumber::VehicleIdentificationNumber') ], count_diff: 1, args: [ Unidom::ArticleNumber::VehicleIdentificationNumber.new(id: model_attributes[:barcode_id]) ] }
35
- ]
22
+ it_behaves_like 'polymorphic scope', model_attributes, :barcode_is, :barcode, [ Unidom::ArticleNumber::Ean13Barcode, Unidom::ArticleNumber::Ean8Barcode, Unidom::ArticleNumber::VehicleIdentificationNumber ]
36
23
 
37
24
  end
38
25
 
@@ -14,6 +14,22 @@ describe Unidom::ArticleNumber::VehicleIdentificationNumber, type: :model do
14
14
 
15
15
  it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
16
16
 
17
+ it_behaves_like 'validates', model_attributes, :code,
18
+ { } => 0,
19
+ { code: nil } => 2,
20
+ { code: '' } => 2,
21
+ { code: '1' } => 1,
22
+ { code: 'A' } => 1,
23
+ { code: '11' } => 1,
24
+ { code: 'AA' } => 1,
25
+ { code: '111' } => 1,
26
+ { code: 'AAA' } => 1,
27
+ { code: 'LFVAA11A6X207535' } => 1,
28
+ { code: 'LFVAA11A6X2075354' } => 1,
29
+ { code: 'LFVAA11A6X2075355' } => 0,
30
+ { code: 'LFVAA11A6X2075356' } => 1,
31
+ { code: 'LFVAA11A6X20753559' } => 2
32
+
17
33
  end
18
34
 
19
35
  end
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module ArticleNumber
3
- VERSION = '2.3.5'.freeze
3
+ VERSION = '2.3.6'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-article_number
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.5
4
+ version: 2.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-11 00:00:00.000000000 Z
11
+ date: 2017-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common