structured_data 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c3e28c50fed381ed0cc90c73f30863e54f762bb
4
- data.tar.gz: 7b9b991bdb22eb6813f17d0bf65c4bd447c8d6b4
3
+ metadata.gz: 2b8269d49642db17d1c658b60037f9a6f8fe5e51
4
+ data.tar.gz: 2b459ed9b39657b41d314e372f6f9c401a3bbaa2
5
5
  SHA512:
6
- metadata.gz: 578b3c2cfb69784aca623090b7917ed03d2cc8955aac8542d4fa4002f6edc2c92e5fb4e55a91a8e2e726f9bbccddcc9bfdee98e96ef79eeb82312e90da183d49
7
- data.tar.gz: 3b692296e36e08016d38c442145871cfa8390462e113eb57132fefa98e8108c8992e059488420126b03d13b828a2a38dd8869316760fde74d3e7d6c9fdd10e69
6
+ metadata.gz: 1244ee184808f3daa261134110f35e82c5c5e62d797e3b44e0952dae6a879d5ced798f4dca8b9cc6e13c3795c73593895a9be5586fb9042096674726e9bce3f2
7
+ data.tar.gz: d40e8ad460f7f73ca6f10611eb7c1cefcdbc6a2862fb070bbb556cf4c1d7fbb85eee1e694caedd82d5c1148e5922f61f7715d125260c72a775bea3454705f4a4
@@ -2,7 +2,7 @@ module StructuredData::ActionView::Helpers
2
2
  include ::ActionView::Helpers
3
3
 
4
4
  def structured_data_tag hash
5
- content_tag(:script, hash, {type: 'ld+json'}, false) # false is used here to prevent html character escaping
5
+ content_tag(:script, hash.to_json, {type: 'application/ld+json'}, false) # false is used here to prevent html character escaping
6
6
  end
7
7
 
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module StructuredData
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -173,3 +173,73 @@ StructuredDataTest: test_truth
173
173
  HelpersTest: test_structured_data_tag_return_text
174
174
  -------------------------------------------------
175
175
   (0.1ms) rollback transaction
176
+  (0.1ms) begin transaction
177
+ ------------------------------
178
+ StructuredDataTest: test_truth
179
+ ------------------------------
180
+  (0.0ms) rollback transaction
181
+  (0.0ms) begin transaction
182
+ -------------------------------------------------
183
+ HelpersTest: test_structured_data_tag_return_text
184
+ -------------------------------------------------
185
+  (0.0ms) rollback transaction
186
+  (0.0ms) begin transaction
187
+ --------------------------------------------------
188
+ HelpersTest: test_structured_data_tag_return_text2
189
+ --------------------------------------------------
190
+  (0.1ms) rollback transaction
191
+  (0.2ms) begin transaction
192
+ ------------------------------
193
+ StructuredDataTest: test_truth
194
+ ------------------------------
195
+  (0.1ms) rollback transaction
196
+  (0.1ms) begin transaction
197
+ -------------------------------------------------
198
+ HelpersTest: test_structured_data_tag_return_text
199
+ -------------------------------------------------
200
+  (0.1ms) rollback transaction
201
+  (0.1ms) begin transaction
202
+ --------------------------------------------------
203
+ HelpersTest: test_structured_data_tag_return_text2
204
+ --------------------------------------------------
205
+  (0.2ms) rollback transaction
206
+  (0.2ms) begin transaction
207
+ --------------------------------------------------
208
+ HelpersTest: test_structured_data_tag_return_text2
209
+ --------------------------------------------------
210
+  (0.1ms) rollback transaction
211
+  (0.1ms) begin transaction
212
+ -------------------------------------------------
213
+ HelpersTest: test_structured_data_tag_return_text
214
+ -------------------------------------------------
215
+  (0.1ms) rollback transaction
216
+  (0.0ms) begin transaction
217
+ ------------------------------
218
+ StructuredDataTest: test_truth
219
+ ------------------------------
220
+  (0.0ms) rollback transaction
221
+  (0.1ms) begin transaction
222
+ ------------------------------
223
+ StructuredDataTest: test_truth
224
+ ------------------------------
225
+  (0.1ms) rollback transaction
226
+  (0.1ms) begin transaction
227
+ -------------------------------------------------
228
+ HelpersTest: test_structured_data_tag_return_text
229
+ -------------------------------------------------
230
+  (0.1ms) rollback transaction
231
+  (0.1ms) begin transaction
232
+ -------------------------------------------------
233
+ HelpersTest: test_structured_data_tag_return_text
234
+ -------------------------------------------------
235
+  (0.0ms) rollback transaction
236
+  (0.1ms) begin transaction
237
+ --------------------------------------------------
238
+ HelpersTest: test_structured_data_tag_return_text2
239
+ --------------------------------------------------
240
+  (0.1ms) rollback transaction
241
+  (0.1ms) begin transaction
242
+ ------------------------------
243
+ StructuredDataTest: test_truth
244
+ ------------------------------
245
+  (0.0ms) rollback transaction
data/test/helpers_test.rb CHANGED
@@ -16,7 +16,7 @@ class HelpersTest < ActiveSupport::TestCase
16
16
  ]
17
17
  }
18
18
  text = structured_data_tag hash
19
- expected = "<script type=\"ld+json\">{\"@context\"=>\"http://schema.org\", \"@type\"=>\"Organization\", \"contactPoint\"=>[{\"@type\"=>\"ContactPoint\", \"contactType\"=>\"customer service\"}]}</script>"
19
+ expected = "<script type=\"application/ld+json\">{\"@context\":\"http://schema.org\",\"@type\":\"Organization\",\"contactPoint\":[{\"@type\":\"ContactPoint\",\"contactType\":\"customer service\"}]}</script>"
20
20
  assert_equal text, expected
21
21
  end
22
22
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: structured_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - endenis