slimmer 3.9.5 → 3.10.0
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.
@@ -10,15 +10,18 @@ module Slimmer::Processors
|
|
10
10
|
|
11
11
|
def filter(content_document, page_template)
|
12
12
|
if search_index && (form = page_template.at_css('form#search'))
|
13
|
-
|
14
|
-
|
15
|
-
form['action'] = uri.to_s
|
13
|
+
input_html = Nokogiri::HTML.fragment(tab_input_tag)
|
14
|
+
form.add_child(input_html)
|
16
15
|
end
|
17
16
|
end
|
18
17
|
|
19
18
|
private
|
20
19
|
|
21
|
-
def
|
20
|
+
def tab_input_tag
|
21
|
+
%Q{<input type="hidden" name="tab" value="#{search_index_tab}">}
|
22
|
+
end
|
23
|
+
|
24
|
+
def search_index_tab
|
22
25
|
"#{search_index}-results"
|
23
26
|
end
|
24
27
|
|
data/lib/slimmer/version.rb
CHANGED
@@ -23,8 +23,8 @@ module SearchIndexSetterTest
|
|
23
23
|
given_response 200, DOCUMENT_WITH_SEARCH, headers
|
24
24
|
|
25
25
|
def test_should_insert_index_field
|
26
|
-
|
27
|
-
assert_equal "
|
26
|
+
search_tab_field = Nokogiri::HTML.parse(last_response.body).at_css('input')['value']
|
27
|
+
assert_equal "government-results", search_tab_field
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -32,7 +32,8 @@ module SearchIndexSetterTest
|
|
32
32
|
given_response 200, DOCUMENT_WITH_SEARCH, {}
|
33
33
|
|
34
34
|
def test_should_not_insert_index_field
|
35
|
-
|
35
|
+
search_tab_field = Nokogiri::HTML.parse(last_response.body).css('input')
|
36
|
+
assert_equal 0, search_tab_field.length
|
36
37
|
end
|
37
38
|
end
|
38
39
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: slimmer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 3.
|
5
|
+
version: 3.10.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ben Griffiths
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2012-12-
|
14
|
+
date: 2012-12-18 00:00:00 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: nokogiri
|
@@ -243,7 +243,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
243
243
|
requirements:
|
244
244
|
- - ">="
|
245
245
|
- !ruby/object:Gem::Version
|
246
|
-
hash:
|
246
|
+
hash: 3028966060044324322
|
247
247
|
segments:
|
248
248
|
- 0
|
249
249
|
version: "0"
|
@@ -252,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
252
252
|
requirements:
|
253
253
|
- - ">="
|
254
254
|
- !ruby/object:Gem::Version
|
255
|
-
hash:
|
255
|
+
hash: 3028966060044324322
|
256
256
|
segments:
|
257
257
|
- 0
|
258
258
|
version: "0"
|