rails-dom-testing 2.0.0 → 2.0.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ecf036ed0fe5b943276e875fe22bdbd0cd892393
|
|
4
|
+
data.tar.gz: f11502f55645a79cade3028f47d0b83ae19db6c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e4defef0a38057db0d5f8b0864cfb81aa4c25f6af1d4f392c03287689d8c3a7e9d13e00eb796d3c48d7f23e52028edf8cf1f74f995ff588838222d84a6ece940
|
|
7
|
+
data.tar.gz: 31a3ccadafc9a27f12024a69b16f1cac994780f64ba43c1cf6932c4824f88a24ceba1e314904c131b8c103e3094ccb2329c7c7bb0c6b13f2967e0c3ddd6f477b
|
data/README.md
CHANGED
|
@@ -5,13 +5,9 @@ Doms are compared via `assert_dom_equal` and `assert_dom_not_equal`.
|
|
|
5
5
|
Elements are asserted via `assert_select`, `assert_select_encoded`, `assert_select_email` and a subset of the dom can be selected with `css_select`.
|
|
6
6
|
The gem is developed for Rails 4.2 and above, and will not work on previous versions.
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Nokogiri::CSS::SyntaxError exceptions when upgrading to Rails 4.2:
|
|
9
9
|
|
|
10
|
-
Nokogiri is slightly
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
DEPRECATION WARNING: The assertion was not run because of an invalid css selector.
|
|
14
|
-
```
|
|
10
|
+
Nokogiri is slightly stricter about the format of CSS selectors than the previous implementation.
|
|
15
11
|
|
|
16
12
|
Check the 4.2 release notes [section on `assert_select`](http://edgeguides.rubyonrails.org/4_2_release_notes.html#assert-select) for help.
|
|
17
13
|
|
|
@@ -62,9 +62,6 @@ module Rails
|
|
|
62
62
|
root = args.size == 1 ? document_root_element : args.shift
|
|
63
63
|
|
|
64
64
|
nodeset(root).css(args.first)
|
|
65
|
-
rescue Nokogiri::CSS::SyntaxError => e
|
|
66
|
-
ActiveSupport::Deprecation.warn("The assertion was not run because of an invalid css selector.\n#{e}", caller(2))
|
|
67
|
-
return
|
|
68
65
|
end
|
|
69
66
|
|
|
70
67
|
# An assertion that selects elements and makes one or more equality tests.
|
|
@@ -177,9 +174,6 @@ module Rails
|
|
|
177
174
|
|
|
178
175
|
nest_selection(matches, &block) if block_given? && !matches.empty?
|
|
179
176
|
end
|
|
180
|
-
rescue Nokogiri::CSS::SyntaxError => e
|
|
181
|
-
ActiveSupport::Deprecation.warn("The assertion was not run because of an invalid css selector.\n#{e}", caller(2))
|
|
182
|
-
return
|
|
183
177
|
end
|
|
184
178
|
|
|
185
179
|
# Extracts the content of an element, treats it as encoded HTML and runs
|
|
@@ -220,15 +220,15 @@ class AssertSelectTest < ActiveSupport::TestCase
|
|
|
220
220
|
# testing invalid selectors
|
|
221
221
|
def test_assert_select_with_invalid_selector
|
|
222
222
|
render_html '<a href="http://example.com">hello</a>'
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
assert_raises Nokogiri::CSS::SyntaxError do
|
|
224
|
+
assert_select("[href=http://example.com]")
|
|
225
225
|
end
|
|
226
226
|
end
|
|
227
227
|
|
|
228
228
|
def test_css_select_with_invalid_selector
|
|
229
229
|
render_html '<a href="http://example.com">hello</a>'
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
assert_raises Nokogiri::CSS::SyntaxError do
|
|
231
|
+
css_select("[href=http://example.com]")
|
|
232
232
|
end
|
|
233
233
|
end
|
|
234
234
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails-dom-testing
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rafael Mendonça França
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2016-
|
|
12
|
+
date: 2016-06-01 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: nokogiri
|