wovnrb 3.10.0 → 3.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wovnrb/services/html_converter.rb +1 -1
- data/lib/wovnrb/version.rb +1 -1
- data/test/lib/services/html_converter_test.rb +20 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59061d2931f333910c0405d78142ffca7317123435456d5524a2b661c3ce6ab8
|
4
|
+
data.tar.gz: 0cf2cb499d0f2626f8a9785aa2cc70b12d692c83344a602f428e2e13979aecef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d2e73e65e1154eea7d199d548b03937049c58e0de5e46c38cf342f73246f01ae35d976bf4eb0fda31521b821293248274b3c52d8135686198bb5ffb68fe4d45
|
7
|
+
data.tar.gz: 1993fe20280c540a57728ca5537f71a4a8d579f2d642db57ff9133f5cb8bb31fba15682be529145ad9a218c1b75679a4aa9460b919645b51f41be8bf9f5fb60a
|
data/lib/wovnrb/version.rb
CHANGED
@@ -452,6 +452,26 @@ module Wovnrb
|
|
452
452
|
assert(translated_html.include?(expected_html))
|
453
453
|
end
|
454
454
|
|
455
|
+
test 'build API compatible html - with insert_hreflangs: false - hreflangs are not added' do
|
456
|
+
settings = default_store_settings
|
457
|
+
settings['insert_hreflangs'] = false
|
458
|
+
converter = prepare_html_converter('<html><body><a>hello</a></body></html>', settings)
|
459
|
+
converted_html, = converter.build_api_compatible_html
|
460
|
+
|
461
|
+
expected_html = "<html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><script src=\"https://j.wovn.io/1\" async=\"true\" data-wovnio=\"key=123456&backend=true&currentLang=en&defaultLang=en&urlPattern=query&langCodeAliases={}&langParamName=wovn&version=WOVN.rb_#{VERSION}\" data-wovnio-type=\"fallback_snippet\"></script></head><body><a>hello</a></body></html>"
|
462
|
+
assert_equal(expected_html, converted_html)
|
463
|
+
end
|
464
|
+
|
465
|
+
test 'Transform HTML - with insert_hreflangs: false - hreflangs are not added' do
|
466
|
+
settings = default_store_settings
|
467
|
+
settings['insert_hreflangs'] = false
|
468
|
+
converter = prepare_html_converter('<html><body><a>hello</a></body></html>', settings)
|
469
|
+
translated_html = converter.build
|
470
|
+
|
471
|
+
expected_html = "<html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><script src=\"https://j.wovn.io/1\" async=\"true\" data-wovnio=\"key=123456&backend=true&currentLang=en&defaultLang=en&urlPattern=query&langCodeAliases={}&langParamName=wovn&version=WOVN.rb_#{VERSION}\" data-wovnio-type=\"fallback_snippet\"></script></head><body><a>hello</a></body></html>"
|
472
|
+
assert_equal(expected_html, translated_html)
|
473
|
+
end
|
474
|
+
|
455
475
|
private
|
456
476
|
|
457
477
|
def prepare_html_converter(input_html, store_options = {})
|
@@ -474,15 +494,6 @@ module Wovnrb
|
|
474
494
|
[store, headers]
|
475
495
|
end
|
476
496
|
|
477
|
-
test 'build API compatible html - with insert_hreflangs: false' do
|
478
|
-
settings = { insert_hreflangs: false }
|
479
|
-
converter = prepare_html_converter('<html><body><a class="test">hello</a></body></html>', settings)
|
480
|
-
converted_html, = converter.build_api_compatible_html
|
481
|
-
|
482
|
-
expected_html = "<html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><script src=\"https://j.wovn.io/1\" async=\"true\" data-wovnio=\"key=123456&backend=true&currentLang=en&defaultLang=en&urlPattern=query&langCodeAliases={}&langParamName=wovn&version=WOVN.rb_#{VERSION}\" data-wovnio-type=\"fallback_snippet\"></script></head><body><a class=\"test\">hello</a></body></html>"
|
483
|
-
assert_equal(expected_html, converted_html)
|
484
|
-
end
|
485
|
-
|
486
497
|
def default_store_settings
|
487
498
|
{
|
488
499
|
'project_token' => '123456',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wovnrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.10.
|
4
|
+
version: 3.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wovn Technologies, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|