izi_json_ld 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.describe PersonEntity do
4
+ let(:item) { described_class.new(person_name: 'Johan') }
5
+
6
+ it 'should be searializable as string' do
7
+ expect(item.to_json).to be_present
8
+ end
9
+
10
+ it 'should have @type' do
11
+ expect(item.as_json).to have_key '@type'
12
+ expect(item.as_json['@type']).to be_present
13
+ expect(item.as_json['@type']).to eq 'Person'
14
+ end
15
+
16
+ it 'allow to pass single sameAs item' do
17
+ item2 = nil
18
+ expect do
19
+ item2 = described_class.new(person_name: 'Johan', sameAs: 'http://example.com')
20
+ end.not_to raise_error
21
+ expect(item2).to be_present
22
+ expect(item2.as_json).to be_present
23
+ expect(item2.as_json['sameAs']).to eq 'http://example.com'
24
+ end
25
+
26
+ it 'allow to pass multiple sameAs links' do
27
+ item2 = nil
28
+ expect do
29
+ item2 = described_class.new(person_name: 'Johan', sameAs: ['http://example.com', 'http://example.com/extra'])
30
+ end.not_to raise_error
31
+ expect(item2).to be_present
32
+ expect(item2.as_json).to be_present
33
+ expect(item2.as_json['sameAs']).to include 'http://example.com'
34
+ expect(item2.as_json['sameAs']).to include 'http://example.com/extra'
35
+ end
36
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: izi_json_ld
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - IzikAJ
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-22 00:00:00.000000000 Z
11
+ date: 2021-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -101,6 +101,7 @@ files:
101
101
  - spec/entities/breadcrumb_list_entity_spec.rb
102
102
  - spec/entities/faq_page_entity_spec.rb
103
103
  - spec/entities/offer_entity_spec.rb
104
+ - spec/entities/person_entity_spec.rb
104
105
  - spec/entities/product_entity_spec.rb
105
106
  - spec/entities/rating_entity_spec.rb
106
107
  - spec/entities/review_entity_spec.rb
@@ -162,6 +163,7 @@ test_files:
162
163
  - spec/entities/review_entity_spec.rb
163
164
  - spec/entities/breadcrumb_list_entity_spec.rb
164
165
  - spec/entities/faq_page_entity_spec.rb
166
+ - spec/entities/person_entity_spec.rb
165
167
  - spec/entities/rating_entity_spec.rb
166
168
  - spec/entities/offer_entity_spec.rb
167
169
  - spec/entities/article_entity_spec.rb