rails-dom-testing 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/rails/dom/testing/assertions/selector_assertions.rb +1 -1
- data/lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb +26 -16
- data/lib/rails/dom/testing/assertions/tag_assertions.rb +1 -1
- data/lib/rails/dom/testing/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 030838e44422116efcf7be92a3d4b7ff1071a4e6
|
4
|
+
data.tar.gz: 3dffb18ee2b4f7eab1675863596589a3be7d750b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0772ce107d6f5480bdf1006f06ef5345afe9001cc016c30e5d8a2cf38fd82eabfb4013e2f34c4ac1801d0fcc2b34543fb98c1e8ed34ba360e283ece3642e2b4b
|
7
|
+
data.tar.gz: 4408e6eb5a7202a2f1319ea21e09cfb7e9b4a35d3de764b9561ab660f08fe5eae874fb0c97ed54eb5ad96cb9948d8da9dff6f856f83427d4c0d4603387528edd
|
data/README.md
CHANGED
@@ -61,8 +61,8 @@ The documentation in [selector_assertions.rb](https://github.com/kaspth/rails-do
|
|
61
61
|
## Read more
|
62
62
|
|
63
63
|
Under the hood the doms are parsed with Nokogiri and you'll generally be working with these two classes:
|
64
|
-
- [`Nokogiri::XML::Node`](http://
|
65
|
-
- [`Nokogiri::XML::NodeSet`](http://
|
64
|
+
- [`Nokogiri::XML::Node`](http://www.rubydoc.info/github/sparklemotion/nokogiri/Nokogiri/XML/Node)
|
65
|
+
- [`Nokogiri::XML::NodeSet`](http://www.rubydoc.info/github/sparklemotion/nokogiri/Nokogiri/XML/NodeSet)
|
66
66
|
|
67
67
|
Read more about Nokogiri:
|
68
68
|
- [Nokogiri](http://nokogiri.org)
|
@@ -1,22 +1,32 @@
|
|
1
1
|
require 'active_support/concern'
|
2
2
|
|
3
|
-
module
|
4
|
-
|
3
|
+
module Rails
|
4
|
+
module Dom
|
5
|
+
module Testing
|
6
|
+
module Assertions
|
7
|
+
module SelectorAssertions
|
8
|
+
module CountDescribable
|
9
|
+
extend ActiveSupport::Concern
|
5
10
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
private
|
12
|
+
def count_description(min, max, count) #:nodoc:
|
13
|
+
if min && max && (max != min)
|
14
|
+
"between #{min} and #{max} elements"
|
15
|
+
elsif min && max && max == min && count
|
16
|
+
"exactly #{count} #{pluralize_element(min)}"
|
17
|
+
elsif min && !(min == 1 && max == 1)
|
18
|
+
"at least #{min} #{pluralize_element(min)}"
|
19
|
+
elsif max
|
20
|
+
"at most #{max} #{pluralize_element(max)}"
|
21
|
+
end
|
22
|
+
end
|
18
23
|
|
19
|
-
|
20
|
-
|
24
|
+
def pluralize_element(quantity)
|
25
|
+
quantity == 1 ? 'element' : 'elements'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
21
30
|
end
|
31
|
+
end
|
22
32
|
end
|
@@ -146,7 +146,7 @@ module Rails
|
|
146
146
|
|
147
147
|
def html_scanner_document
|
148
148
|
xml = @response.content_type =~ /xml$/
|
149
|
-
@
|
149
|
+
@html_scanner_document ||= HTML::Document.new(@response.body, false, xml)
|
150
150
|
end
|
151
151
|
end
|
152
152
|
end
|
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: 1.0.
|
4
|
+
version: 1.0.7
|
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: 2015-
|
12
|
+
date: 2015-08-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
147
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.4.
|
148
|
+
rubygems_version: 2.4.7
|
149
149
|
signing_key:
|
150
150
|
specification_version: 4
|
151
151
|
summary: Dom and Selector assertions for Rails applications
|
@@ -154,3 +154,4 @@ test_files:
|
|
154
154
|
- test/selector_assertions_test.rb
|
155
155
|
- test/tag_assertions_test.rb
|
156
156
|
- test/test_helper.rb
|
157
|
+
has_rdoc:
|