arbre 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +39 -12
- data/README.md +3 -3
- data/Rakefile +1 -1
- data/lib/arbre/context.rb +3 -3
- data/lib/arbre/element.rb +1 -1
- data/lib/arbre/html/class_list.rb +1 -4
- data/lib/arbre/html/document.rb +1 -1
- data/lib/arbre/html/html5_elements.rb +4 -4
- data/lib/arbre/html/tag.rb +5 -1
- data/lib/arbre/rails/forms.rb +2 -2
- data/lib/arbre/version.rb +1 -1
- data/spec/arbre/integration/html_spec.rb +10 -8
- data/spec/arbre/unit/element_finder_methods_spec.rb +10 -10
- data/spec/arbre/unit/element_spec.rb +2 -2
- data/spec/arbre/unit/html/class_list_spec.rb +1 -1
- data/spec/arbre/unit/html/tag_attributes_spec.rb +3 -3
- data/spec/arbre/unit/html/tag_spec.rb +9 -9
- data/spec/rails/integration/forms_spec.rb +7 -7
- data/spec/rails/integration/rendering_spec.rb +7 -7
- data/spec/rails/rails_spec_helper.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: 6c1b05989079a4f6408269a6d5079ac41b957e2c
|
4
|
+
data.tar.gz: 283b93e148607c2d7537ebab5f330b10312f1828
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 747b0ee1ddf4ea35e05aaec1d072d96a65edd94d8b63163f791af329baf91a259bd98fba5aaa49e793b5516b357a9378688e59b35e7a0c1b9bb842c892e88ec8
|
7
|
+
data.tar.gz: 4ebf3319eea32ff425ba13ce734a4c5b11cb5a666a0729c6898f1b9fbb0a326e429d5e3e3eeb421155c8c0e0d6a40fd1b386bfe52a2abf99ecc55e110030ad29
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,30 +1,38 @@
|
|
1
|
-
##
|
1
|
+
## unreleased [☰](https://github.com/activeadmin/arbre/compare/v1.0.3...master)
|
2
2
|
|
3
|
-
|
4
|
-
* prevent `Arbre::Element#flatten` infinite recursion (@seanlinsley, #32)
|
5
|
-
* make `find_by_class` correctly find children by class (@kaapa, #33)
|
3
|
+
## 1.0.3 [☰](https://github.com/activeadmin/arbre/compare/v1.0.2...v1.0.3)
|
6
4
|
|
7
|
-
|
5
|
+
* Performance improvements [#40][] by [@alexesDev][]
|
6
|
+
* Added all void elements as self-closing tags [#39][] by [@OscarBarrett][]
|
7
|
+
* Missing tags added [#36][] / [#39][] by [@dtaniwaki][] and [@OscarBarrett][]
|
8
8
|
|
9
|
-
|
9
|
+
## 1.0.2 [☰](https://github.com/activeadmin/arbre/compare/v1.0.1...v1.0.2)
|
10
|
+
|
11
|
+
* make `Element#inspect` behave correctly in Ruby 2.0 [#16][] by [@seanlinsley][]
|
12
|
+
* prevent `Arbre::Element#flatten` infinite recursion [#32][] by [@seanlinsley][]
|
13
|
+
* make `find_by_class` correctly find children by class [#33][] by [@kaapa][]
|
14
|
+
|
15
|
+
## 1.0.1 [☰](https://github.com/activeadmin/arbre/compare/v1.0.0...v1.0.1)
|
16
|
+
|
17
|
+
* Template handler converts to string to satisfy Rack::Lint [#6][] by [@jpmckinney][]
|
10
18
|
* Fix to `Tag#add_class` when passing a string of classes to Tag build method
|
11
|
-
|
12
|
-
* Not longer uses the default separator
|
19
|
+
[#4][] by [@gregbell][]
|
20
|
+
* Not longer uses the default separator [#7][] by [@LTe][]
|
13
21
|
|
14
|
-
## 1.0.0
|
22
|
+
## 1.0.0 [☰](https://github.com/activeadmin/arbre/compare/v1.0.0.rc4...v1.0.0)
|
15
23
|
|
16
24
|
* Added support for the use of `:for` with non Active Model objects
|
17
25
|
|
18
|
-
## 1.0.0.rc4
|
26
|
+
## 1.0.0.rc4 [☰](https://github.com/activeadmin/arbre/compare/v1.0.0.rc3...v1.0.0.rc4)
|
19
27
|
|
20
28
|
* Fix issue where user could call `symbolize_keys!` on a
|
21
29
|
HashWithIndifferentAccess which doesn't implement the method
|
22
30
|
|
23
|
-
## 1.0.0.rc3
|
31
|
+
## 1.0.0.rc3 [☰](https://github.com/activeadmin/arbre/compare/v1.0.0.rc2...v1.0.0.rc3)
|
24
32
|
|
25
33
|
* Implemented `Arbre::HTML::Tag#default_id_for_prefix`
|
26
34
|
|
27
|
-
## 1.0.0.rc2
|
35
|
+
## 1.0.0.rc2 [☰](https://github.com/activeadmin/arbre/compare/v1.0.0.rc1...v1.0.0.rc2)
|
28
36
|
|
29
37
|
* Fixed bug where Component's build methods were being rendered within the
|
30
38
|
parent context.
|
@@ -32,3 +40,22 @@
|
|
32
40
|
## 1.0.0.rc1
|
33
41
|
|
34
42
|
Initial release and extraction from Active Admin
|
43
|
+
|
44
|
+
<!--- The following link definition list is generated by PimpMyChangelog --->
|
45
|
+
[#4]: https://github.com/activeadmin/arbre/issues/4
|
46
|
+
[#6]: https://github.com/activeadmin/arbre/issues/6
|
47
|
+
[#7]: https://github.com/activeadmin/arbre/issues/7
|
48
|
+
[#16]: https://github.com/activeadmin/arbre/issues/16
|
49
|
+
[#32]: https://github.com/activeadmin/arbre/issues/32
|
50
|
+
[#33]: https://github.com/activeadmin/arbre/issues/33
|
51
|
+
[#36]: https://github.com/activeadmin/arbre/issues/36
|
52
|
+
[#39]: https://github.com/activeadmin/arbre/issues/39
|
53
|
+
[#40]: https://github.com/activeadmin/arbre/issues/40
|
54
|
+
[@LTe]: https://github.com/LTe
|
55
|
+
[@OscarBarrett]: https://github.com/OscarBarrett
|
56
|
+
[@alexesDev]: https://github.com/alexesDev
|
57
|
+
[@dtaniwaki]: https://github.com/dtaniwaki
|
58
|
+
[@gregbell]: https://github.com/gregbell
|
59
|
+
[@jpmckinney]: https://github.com/jpmckinney
|
60
|
+
[@kaapa]: https://github.com/kaapa
|
61
|
+
[@seanlinsley]: https://github.com/seanlinsley
|
data/README.md
CHANGED
@@ -58,7 +58,7 @@ class Panel < Arbre::Component
|
|
58
58
|
def build(title, attributes = {})
|
59
59
|
super(attributes)
|
60
60
|
|
61
|
-
h3(title, :
|
61
|
+
h3(title, class: "panel-title")
|
62
62
|
end
|
63
63
|
end
|
64
64
|
```
|
@@ -71,7 +71,7 @@ You can now use this panel in any Arbre context:
|
|
71
71
|
|
72
72
|
```ruby
|
73
73
|
html = Arbre::Context.new do
|
74
|
-
panel "Hello World", :
|
74
|
+
panel "Hello World", id: "my-panel" do
|
75
75
|
span "Inside the panel"
|
76
76
|
end
|
77
77
|
end
|
@@ -92,7 +92,7 @@ To insert unwrapped text nodes use `text_node`:
|
|
92
92
|
|
93
93
|
```ruby
|
94
94
|
html = Arbre::Context.new do
|
95
|
-
panel "Hello World", :
|
95
|
+
panel "Hello World", id: "my-panel" do
|
96
96
|
span "Inside the panel"
|
97
97
|
text_node "Plain text"
|
98
98
|
end
|
data/Rakefile
CHANGED
data/lib/arbre/context.rb
CHANGED
@@ -17,7 +17,7 @@ module Arbre
|
|
17
17
|
# within the block. To pass local variables into the Context, use the
|
18
18
|
# assigns param.
|
19
19
|
#
|
20
|
-
# html = Arbre::Context.new({:
|
20
|
+
# html = Arbre::Context.new({one: 1}) do
|
21
21
|
# h1 "Your number #{one}"
|
22
22
|
# end
|
23
23
|
#
|
@@ -67,8 +67,8 @@ module Arbre
|
|
67
67
|
end
|
68
68
|
alias :length :bytesize
|
69
69
|
|
70
|
-
def
|
71
|
-
super || cached_html.respond_to?(method)
|
70
|
+
def respond_to_missing?(method, include_all)
|
71
|
+
super || cached_html.respond_to?(method, include_all)
|
72
72
|
end
|
73
73
|
|
74
74
|
# Webservers treat Arbre::Context as a string. We override
|
data/lib/arbre/element.rb
CHANGED
@@ -47,7 +47,7 @@ module Arbre
|
|
47
47
|
|
48
48
|
if child.respond_to?(:parent)
|
49
49
|
# Remove the child
|
50
|
-
child.parent.remove_child(child) if child.parent
|
50
|
+
child.parent.remove_child(child) if child.parent && child.parent != self
|
51
51
|
# Set ourselves as the parent
|
52
52
|
child.parent = self
|
53
53
|
end
|
data/lib/arbre/html/document.rb
CHANGED
@@ -7,11 +7,11 @@ module Arbre
|
|
7
7
|
:dfn, :div, :dl, :dt, :em, :embed, :fieldset, :figcaption, :figure,
|
8
8
|
:footer, :form, :h1, :h2, :h3, :h4, :h5, :h6, :head, :header, :hgroup,
|
9
9
|
:hr, :html, :i, :iframe, :img, :input, :ins, :keygen, :kbd, :label,
|
10
|
-
:legend, :li, :link, :map, :mark, :menu, :meta, :meter, :nav, :noscript,
|
11
|
-
:object, :ol, :optgroup, :option, :output, :pre, :progress, :q,
|
10
|
+
:legend, :li, :link, :map, :mark, :menu, :menuitem, :meta, :meter, :nav, :noscript,
|
11
|
+
:object, :ol, :optgroup, :option, :output, :param, :pre, :progress, :q,
|
12
12
|
:s, :samp, :script, :section, :select, :small, :source, :span,
|
13
|
-
:strong, :style, :sub, :summary, :sup, :table, :tbody, :td,
|
14
|
-
:textarea, :tfoot, :th, :thead, :time, :title, :tr, :ul, :var, :video ]
|
13
|
+
:strong, :style, :sub, :summary, :sup, :svg, :table, :tbody, :td,
|
14
|
+
:textarea, :tfoot, :th, :thead, :time, :title, :tr, :track, :ul, :var, :video, :wbr ]
|
15
15
|
|
16
16
|
HTML5_ELEMENTS = [ :p ] + AUTO_BUILD_ELEMENTS
|
17
17
|
|
data/lib/arbre/html/tag.rb
CHANGED
@@ -6,6 +6,10 @@ module Arbre
|
|
6
6
|
class Tag < Element
|
7
7
|
attr_reader :attributes
|
8
8
|
|
9
|
+
# See: http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements
|
10
|
+
SELF_CLOSING_ELEMENTS = [ :area, :base, :br, :col, :embed, :hr, :img, :input, :keygen, :link,
|
11
|
+
:menuitem, :meta, :param, :source, :track, :wbr ]
|
12
|
+
|
9
13
|
def initialize(*)
|
10
14
|
super
|
11
15
|
@attributes = Attributes.new
|
@@ -130,7 +134,7 @@ module Arbre
|
|
130
134
|
end
|
131
135
|
|
132
136
|
def self_closing_tag?
|
133
|
-
|
137
|
+
SELF_CLOSING_ELEMENTS.include?(tag_name.to_sym)
|
134
138
|
end
|
135
139
|
|
136
140
|
def no_child?
|
data/lib/arbre/rails/forms.rb
CHANGED
@@ -16,8 +16,8 @@ module Arbre
|
|
16
16
|
proxy_call_to_form :select, *args
|
17
17
|
end
|
18
18
|
|
19
|
-
def
|
20
|
-
if form_builder && form_builder.respond_to?(
|
19
|
+
def respond_to_missing?(method, include_all)
|
20
|
+
if form_builder && form_builder.respond_to?(method, include_all)
|
21
21
|
true
|
22
22
|
else
|
23
23
|
super
|
data/lib/arbre/version.rb
CHANGED
@@ -171,26 +171,28 @@ HTML
|
|
171
171
|
|
172
172
|
it "should not self-close script tags" do
|
173
173
|
expect(arbre {
|
174
|
-
script :
|
174
|
+
script type: 'text/javascript'
|
175
175
|
}.to_s).to eq("<script type=\"text/javascript\"></script>\n")
|
176
176
|
end
|
177
177
|
|
178
178
|
it "should self-close meta tags" do
|
179
179
|
expect(arbre {
|
180
|
-
meta :
|
180
|
+
meta content: "text/html; charset=utf-8"
|
181
181
|
}.to_s).to eq("<meta content=\"text/html; charset=utf-8\"/>\n")
|
182
182
|
end
|
183
183
|
|
184
184
|
it "should self-close link tags" do
|
185
185
|
expect(arbre {
|
186
|
-
link :
|
186
|
+
link rel: "stylesheet"
|
187
187
|
}.to_s).to eq("<link rel=\"stylesheet\"/>\n")
|
188
188
|
end
|
189
189
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
190
|
+
Arbre::HTML::Tag::SELF_CLOSING_ELEMENTS.each do |tag|
|
191
|
+
it "should self-close #{tag} tags" do
|
192
|
+
expect(arbre {
|
193
|
+
send(tag)
|
194
|
+
}.to_s).to eq("<#{tag}/>\n")
|
195
|
+
end
|
194
196
|
end
|
195
197
|
|
196
198
|
end
|
@@ -237,7 +239,7 @@ HTML
|
|
237
239
|
|
238
240
|
it "should escape the contents of attributes" do
|
239
241
|
expect(arbre {
|
240
|
-
span(:
|
242
|
+
span(class: "<br />")
|
241
243
|
}.to_s).to eq <<-HTML
|
242
244
|
<span class="<br />"></span>
|
243
245
|
HTML
|
@@ -69,8 +69,8 @@ describe Arbre::Element, "Finder Methods" do
|
|
69
69
|
|
70
70
|
it "should return a child element" do
|
71
71
|
html = arbre do
|
72
|
-
div :
|
73
|
-
div :
|
72
|
+
div class: "some_class"
|
73
|
+
div class: "my_class"
|
74
74
|
end
|
75
75
|
elements = html.get_elements_by_class_name("my_class")
|
76
76
|
expect(elements.size).to eq(1)
|
@@ -79,9 +79,9 @@ describe Arbre::Element, "Finder Methods" do
|
|
79
79
|
|
80
80
|
it "should return multple child elements" do
|
81
81
|
html = arbre do
|
82
|
-
div :
|
83
|
-
div :
|
84
|
-
div :
|
82
|
+
div class: "some_class"
|
83
|
+
div class: "my_class"
|
84
|
+
div class: "my_class"
|
85
85
|
end
|
86
86
|
elements = html.get_elements_by_class_name("my_class")
|
87
87
|
expect(elements.size).to eq(2)
|
@@ -91,9 +91,9 @@ describe Arbre::Element, "Finder Methods" do
|
|
91
91
|
|
92
92
|
it "should return elements that match one of several classes" do
|
93
93
|
html = arbre do
|
94
|
-
div :
|
95
|
-
div :
|
96
|
-
div :
|
94
|
+
div class: "some_class this_class"
|
95
|
+
div class: "some_class"
|
96
|
+
div class: "other_class"
|
97
97
|
|
98
98
|
end
|
99
99
|
elements = html.get_elements_by_class_name("this_class")
|
@@ -103,8 +103,8 @@ describe Arbre::Element, "Finder Methods" do
|
|
103
103
|
|
104
104
|
it "should return a grandchild element" do
|
105
105
|
html = arbre do
|
106
|
-
div :
|
107
|
-
div :
|
106
|
+
div class: "some_class" do
|
107
|
+
div class: "my_class"
|
108
108
|
end
|
109
109
|
end
|
110
110
|
elements = html.get_elements_by_class_name("my_class")
|
@@ -19,7 +19,7 @@ describe Arbre::Element do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should have a set of local assigns" do
|
22
|
-
context = Arbre::Context.new :
|
22
|
+
context = Arbre::Context.new hello: "World"
|
23
23
|
element = Arbre::Element.new(context)
|
24
24
|
expect(element.assigns[:hello]).to eq("World")
|
25
25
|
end
|
@@ -56,7 +56,7 @@ describe Arbre::Element do
|
|
56
56
|
|
57
57
|
describe "passing in assigns" do
|
58
58
|
let(:post){ double }
|
59
|
-
let(:assigns){ {:
|
59
|
+
let(:assigns){ {post: post} }
|
60
60
|
|
61
61
|
it "should be accessible via a method call" do
|
62
62
|
element = Arbre::Element.new(Arbre::Context.new(assigns))
|
@@ -6,10 +6,10 @@ describe Arbre::HTML::Tag, "Attributes" do
|
|
6
6
|
|
7
7
|
describe "attributes" do
|
8
8
|
|
9
|
-
before { tag.build :
|
9
|
+
before { tag.build id: "my_id" }
|
10
10
|
|
11
11
|
it "should have an attributes hash" do
|
12
|
-
expect(tag.attributes).to eq({:
|
12
|
+
expect(tag.attributes).to eq({id: "my_id"})
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should render the attributes to html" do
|
@@ -43,7 +43,7 @@ describe Arbre::HTML::Tag, "Attributes" do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it "should remove an attribute" do
|
46
|
-
expect(tag.attributes).to eq({:
|
46
|
+
expect(tag.attributes).to eq({id: "my_id"})
|
47
47
|
expect(tag.remove_attribute(:id)).to eq("my_id")
|
48
48
|
expect(tag.attributes).to eq({})
|
49
49
|
end
|
@@ -5,24 +5,24 @@ describe Arbre::HTML::Tag do
|
|
5
5
|
let(:tag){ Arbre::HTML::Tag.new }
|
6
6
|
|
7
7
|
describe "building a new tag" do
|
8
|
-
before { tag.build "Hello World", :
|
8
|
+
before { tag.build "Hello World", id: "my_id" }
|
9
9
|
|
10
10
|
it "should set the contents to a string" do
|
11
11
|
expect(tag.content).to eq("Hello World")
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should set the hash of options to the attributes" do
|
15
|
-
expect(tag.attributes).to eq({ :
|
15
|
+
expect(tag.attributes).to eq({ id: "my_id" })
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
describe "creating a tag 'for' an object" do
|
20
|
-
let(:model_name){ double(:
|
21
|
-
let(:resource_class){ double(:
|
22
|
-
let(:resource){ double(:
|
20
|
+
let(:model_name){ double(singular: "resource_class")}
|
21
|
+
let(:resource_class){ double(model_name: model_name) }
|
22
|
+
let(:resource){ double(class: resource_class, to_key: ['5'])}
|
23
23
|
|
24
24
|
before do
|
25
|
-
tag.build :
|
25
|
+
tag.build for: resource
|
26
26
|
end
|
27
27
|
it "should set the id to the type and id" do
|
28
28
|
expect(tag.id).to eq("resource_class_5")
|
@@ -34,10 +34,10 @@ describe Arbre::HTML::Tag do
|
|
34
34
|
|
35
35
|
|
36
36
|
describe "for an object that doesn't have a model_name" do
|
37
|
-
let(:resource_class){ double(:
|
37
|
+
let(:resource_class){ double(name: 'ResourceClass') }
|
38
38
|
|
39
39
|
before do
|
40
|
-
tag.build :
|
40
|
+
tag.build for: resource
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should set the id to the type and id" do
|
@@ -93,7 +93,7 @@ describe Arbre::HTML::Tag do
|
|
93
93
|
|
94
94
|
it "should create a class list from a string" do
|
95
95
|
tag = Arbre::HTML::Tag.new
|
96
|
-
tag.build(:
|
96
|
+
tag.build(class: "first-class")
|
97
97
|
tag.add_class "second-class"
|
98
98
|
expect(tag.class_list.size).to eq(2)
|
99
99
|
end
|
@@ -10,7 +10,7 @@ describe "Building forms" do
|
|
10
10
|
|
11
11
|
let(:form) do
|
12
12
|
arbre do
|
13
|
-
form_for MockPerson.new, :
|
13
|
+
form_for MockPerson.new, url: "/" do |f|
|
14
14
|
f.label :name
|
15
15
|
f.text_field :name
|
16
16
|
end
|
@@ -22,7 +22,7 @@ describe "Building forms" do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
it "should include the hidden authenticity token" do
|
25
|
-
expect(html).to include '<input
|
25
|
+
expect(html).to include '<input type="hidden" name="authenticity_token" value="AUTH_TOKEN" />'
|
26
26
|
end
|
27
27
|
|
28
28
|
it "should create a label" do
|
@@ -39,7 +39,7 @@ describe "Building forms" do
|
|
39
39
|
|
40
40
|
let(:form) do
|
41
41
|
arbre do
|
42
|
-
form_for MockPerson.new, :
|
42
|
+
form_for MockPerson.new, url: "/" do |f|
|
43
43
|
f.label :name
|
44
44
|
f.text_field :name
|
45
45
|
f.fields_for :permission do |pf|
|
@@ -51,7 +51,7 @@ describe "Building forms" do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
it "should render nested label" do
|
54
|
-
expect(html).to have_selector("form label[for=mock_person_permission_admin]", :
|
54
|
+
expect(html).to have_selector("form label[for=mock_person_permission_admin]", text: "Admin")
|
55
55
|
end
|
56
56
|
|
57
57
|
it "should render nested label" do
|
@@ -67,7 +67,7 @@ describe "Building forms" do
|
|
67
67
|
describe "forms with other elements" do
|
68
68
|
let(:form) do
|
69
69
|
arbre do
|
70
|
-
form_for MockPerson.new, :
|
70
|
+
form_for MockPerson.new, url: "/" do |f|
|
71
71
|
|
72
72
|
div do
|
73
73
|
f.label :name
|
@@ -79,9 +79,9 @@ describe "Building forms" do
|
|
79
79
|
f.text_field :name
|
80
80
|
end
|
81
81
|
|
82
|
-
div :
|
82
|
+
div class: "permissions" do
|
83
83
|
f.fields_for :permission do |pf|
|
84
|
-
div :
|
84
|
+
div class: "permissions_label" do
|
85
85
|
pf.label :admin
|
86
86
|
end
|
87
87
|
pf.check_box :admin
|
@@ -33,7 +33,7 @@ class TestController < ActionController::Base
|
|
33
33
|
end
|
34
34
|
|
35
35
|
|
36
|
-
describe TestController, "Rendering with Arbre", :
|
36
|
+
describe TestController, "Rendering with Arbre", type: :request do
|
37
37
|
let(:body){ response.body }
|
38
38
|
|
39
39
|
it "should render the empty template" do
|
@@ -44,8 +44,8 @@ describe TestController, "Rendering with Arbre", :type => :request do
|
|
44
44
|
it "should render a simple page" do
|
45
45
|
get "/test/render_simple_page"
|
46
46
|
expect(response).to be_success
|
47
|
-
expect(body).to have_selector("h1", :
|
48
|
-
expect(body).to have_selector("p", :
|
47
|
+
expect(body).to have_selector("h1", text: "Hello World")
|
48
|
+
expect(body).to have_selector("p", text: "Hello again!")
|
49
49
|
end
|
50
50
|
|
51
51
|
it "should render an arb partial" do
|
@@ -69,15 +69,15 @@ EOS
|
|
69
69
|
end
|
70
70
|
|
71
71
|
it "should render with instance variables" do
|
72
|
-
get "test/render_with_instance_variable"
|
72
|
+
get "/test/render_with_instance_variable"
|
73
73
|
expect(response).to be_success
|
74
|
-
expect(body).to have_selector("h1", :
|
74
|
+
expect(body).to have_selector("h1", text: "From Instance Var")
|
75
75
|
end
|
76
76
|
|
77
77
|
it "should render an arbre partial with assignments" do
|
78
|
-
get "test/render_partial_with_instance_variable"
|
78
|
+
get "/test/render_partial_with_instance_variable"
|
79
79
|
expect(response).to be_success
|
80
|
-
expect(body).to have_selector("p", :
|
80
|
+
expect(body).to have_selector("p", text: "Partial: From Instance Var")
|
81
81
|
end
|
82
82
|
|
83
83
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arbre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Bell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.4.5
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: An Object Oriented DOM Tree in Ruby
|
@@ -140,3 +140,4 @@ test_files:
|
|
140
140
|
- spec/rails/templates/erb/_partial.erb
|
141
141
|
- spec/spec_helper.rb
|
142
142
|
- spec/support/bundle.rb
|
143
|
+
has_rdoc:
|