viewaide 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +8 -0
- data/VERSION +1 -1
- data/lib/viewaide/helpers/grid_helper.rb +1 -1
- data/test/form_helper_test.rb +7 -7
- data/test/grid_helper_test.rb +55 -55
- data/viewaide.gemspec +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
@@ -18,3 +18,11 @@ begin
|
|
18
18
|
rescue LoadError
|
19
19
|
puts "Jeweler not available. Install it with: gem install jeweler"
|
20
20
|
end
|
21
|
+
|
22
|
+
Rake::TestTask.new do |t|
|
23
|
+
t.libs << "test"
|
24
|
+
t.test_files = FileList["test/*_test.rb"]
|
25
|
+
t.verbose = true
|
26
|
+
end
|
27
|
+
|
28
|
+
task :default => [:test]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/test/form_helper_test.rb
CHANGED
@@ -60,19 +60,19 @@ class FormHelperTest < Viewaide::ViewTestCase
|
|
60
60
|
|
61
61
|
should "assign default class if width class is passed as the only class" do
|
62
62
|
show_view "<% set :half do %>words<% end %>" do
|
63
|
-
assert_select "div.text.
|
63
|
+
assert_select "div.text.span-12", "words"
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
67
|
should "assign default class if last class is passed as the only class" do
|
68
68
|
show_view "<% set :half, :last do %>words<% end %>" do
|
69
|
-
assert_select "div.
|
69
|
+
assert_select "div.span-12.text.last", "words"
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
73
|
should "assign default class if error class is passed" do
|
74
74
|
show_view "<% set :half, :last, :error do %>words<% end %>" do
|
75
|
-
assert_select "div.
|
75
|
+
assert_select "div.span-12.text.last.error", "words"
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
@@ -101,14 +101,14 @@ class FormHelperTest < Viewaide::ViewTestCase
|
|
101
101
|
end
|
102
102
|
|
103
103
|
should "allow adding fieldset classes" do
|
104
|
-
show_view "<% fieldset :hform,
|
105
|
-
assert_select "fieldset.hform.
|
104
|
+
show_view "<% fieldset :hform, :last do %>words<% end %>" do
|
105
|
+
assert_select "fieldset.hform.last", "words"
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
109
109
|
should "allow adding fieldset classes and a legend" do
|
110
|
-
show_view "<% fieldset 'User Information', :hform,
|
111
|
-
assert_select "fieldset.hform.
|
110
|
+
show_view "<% fieldset 'User Information', :hform, :last do %>words<% end %>" do
|
111
|
+
assert_select "fieldset.hform.last", /words/ do
|
112
112
|
assert_select "h3.legend", "User Information"
|
113
113
|
end
|
114
114
|
end
|
data/test/grid_helper_test.rb
CHANGED
@@ -29,16 +29,16 @@ class GridHelperTest < Viewaide::ViewTestCase
|
|
29
29
|
|
30
30
|
show_view template do
|
31
31
|
assert_select ".container", 1
|
32
|
-
assert_select ".container.
|
33
|
-
assert_select ".
|
34
|
-
assert_select ".
|
35
|
-
assert_select ".
|
36
|
-
assert_select ".
|
37
|
-
assert_select ".
|
32
|
+
assert_select ".container.span-24", 0
|
33
|
+
assert_select ".span-24", 1
|
34
|
+
assert_select ".span-12", 2
|
35
|
+
assert_select ".span-12#primary", 1
|
36
|
+
assert_select ".span-12#secondary", 1
|
37
|
+
assert_select ".span-4", 2
|
38
38
|
assert_select ".prepend-4", 1
|
39
|
-
assert_select ".
|
40
|
-
assert_select ".
|
41
|
-
assert_select ".
|
39
|
+
assert_select ".span-24.last", 0
|
40
|
+
assert_select ".span-12.last", 1
|
41
|
+
assert_select ".span-4.last", 1
|
42
42
|
assert_select "hr", 2
|
43
43
|
end
|
44
44
|
end
|
@@ -55,12 +55,12 @@ class GridHelperTest < Viewaide::ViewTestCase
|
|
55
55
|
)
|
56
56
|
|
57
57
|
show_view template do
|
58
|
-
assert_select "div.
|
59
|
-
assert_select "fieldset.hform.
|
60
|
-
assert_select "div.
|
61
|
-
assert_select "div.
|
58
|
+
assert_select "div.span-24" do
|
59
|
+
assert_select "fieldset.hform.span-12" do
|
60
|
+
assert_select "div.span-4", "text"
|
61
|
+
assert_select "div.span-8.last", "more text"
|
62
62
|
end
|
63
|
-
assert_select "table.
|
63
|
+
assert_select "table.span-12.last", "table"
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
@@ -87,24 +87,24 @@ class GridHelperTest < Viewaide::ViewTestCase
|
|
87
87
|
)
|
88
88
|
|
89
89
|
show_view template do
|
90
|
-
assert_select "fieldset.hform.
|
91
|
-
assert_select "div.
|
92
|
-
assert_select "div.
|
93
|
-
|
94
|
-
assert_select "div.
|
95
|
-
assert_select "div.
|
96
|
-
assert_select "div.
|
97
|
-
assert_select "div.
|
98
|
-
assert_select "div.
|
90
|
+
assert_select "fieldset.hform.span-12" do
|
91
|
+
assert_select "div.span-4", "text"
|
92
|
+
assert_select "div.span-8.last", "more text"
|
93
|
+
|
94
|
+
assert_select "div.span-12.last" do
|
95
|
+
assert_select "div.span-4", "one third"
|
96
|
+
assert_select "div.span-8.last" do
|
97
|
+
assert_select "div.span-4", "half"
|
98
|
+
assert_select "div.span-4.last", "last half"
|
99
99
|
end
|
100
100
|
end
|
101
101
|
end
|
102
|
-
assert_select "div.
|
103
|
-
assert_select "div.
|
104
|
-
assert_select "div.
|
105
|
-
assert_select "div.
|
102
|
+
assert_select "div.span-8" do
|
103
|
+
assert_select "div.span-2", "two wide"
|
104
|
+
assert_select "div.span-4", "four wide"
|
105
|
+
assert_select "div.span-2.last", "two more wide"
|
106
106
|
end
|
107
|
-
assert_select "table.
|
107
|
+
assert_select "table.span-4.last", "table"
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
@@ -128,20 +128,20 @@ class GridHelperTest < Viewaide::ViewTestCase
|
|
128
128
|
)
|
129
129
|
|
130
130
|
show_view template do
|
131
|
-
assert_select "div.container.
|
131
|
+
assert_select "div.container.span-24", 1
|
132
132
|
assert_select "div.container" do
|
133
|
-
assert_select "div.
|
134
|
-
assert_select "fieldset.hform.
|
135
|
-
assert_select "div.
|
136
|
-
assert_select "div.
|
133
|
+
assert_select "div.span-12" do
|
134
|
+
assert_select "fieldset.hform.span-6" do
|
135
|
+
assert_select "div.span-2", "text"
|
136
|
+
assert_select "div.span-4.last", "more text"
|
137
137
|
end
|
138
|
-
assert_select "table.
|
138
|
+
assert_select "table.span-6.last", "table"
|
139
139
|
end
|
140
140
|
|
141
|
-
assert_select "div.
|
141
|
+
assert_select "div.span-8", "one third!"
|
142
142
|
|
143
|
-
assert_select "div.
|
144
|
-
assert_select "fieldset.vform.
|
143
|
+
assert_select "div.span-4.last" do
|
144
|
+
assert_select "fieldset.vform.span-4.last" do
|
145
145
|
assert_select "div", "text"
|
146
146
|
end
|
147
147
|
end
|
@@ -149,7 +149,7 @@ class GridHelperTest < Viewaide::ViewTestCase
|
|
149
149
|
end
|
150
150
|
end
|
151
151
|
|
152
|
-
should "properly assign classes when using
|
152
|
+
should "properly assign classes when using Easel grid" do
|
153
153
|
template = %(
|
154
154
|
<% container do %>
|
155
155
|
<% column do %>
|
@@ -171,21 +171,21 @@ class GridHelperTest < Viewaide::ViewTestCase
|
|
171
171
|
<% end %>
|
172
172
|
<% end %>
|
173
173
|
)
|
174
|
-
Viewaide::Helpers::GridHelper.
|
174
|
+
Viewaide::Helpers::GridHelper.easel_grid!
|
175
175
|
show_view template do
|
176
176
|
assert_select ".container", 1
|
177
|
-
assert_select ".
|
178
|
-
assert_select ".
|
179
|
-
assert_select ".
|
180
|
-
assert_select ".
|
181
|
-
assert_select ".
|
177
|
+
assert_select ".col-24", 1
|
178
|
+
assert_select ".col-12", 2
|
179
|
+
assert_select ".col-12#primary", 1
|
180
|
+
assert_select ".col-12#secondary", 1
|
181
|
+
assert_select ".col-4", 2
|
182
182
|
assert_select ".prepend-4", 1
|
183
|
-
assert_select ".
|
184
|
-
assert_select ".
|
185
|
-
assert_select ".
|
183
|
+
assert_select ".col-24.col-last", 0
|
184
|
+
assert_select ".col-12.col-last", 1
|
185
|
+
assert_select ".col-4.col-last", 1
|
186
186
|
assert_select "hr", 2
|
187
187
|
end
|
188
|
-
Viewaide::Helpers::GridHelper.
|
188
|
+
Viewaide::Helpers::GridHelper.blueprint_grid!
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
@@ -195,7 +195,7 @@ class GridHelperTest < Viewaide::ViewTestCase
|
|
195
195
|
show_view %(
|
196
196
|
<% column :id => "my-custom-id", :class => "content" do %>words<% end %>
|
197
197
|
) do
|
198
|
-
assert_select "div.
|
198
|
+
assert_select "div.span-24.content#my-custom-id", "words"
|
199
199
|
end
|
200
200
|
end
|
201
201
|
|
@@ -208,18 +208,18 @@ class GridHelperTest < Viewaide::ViewTestCase
|
|
208
208
|
<% column 1, :last do %>one<% end %>
|
209
209
|
<% end %>
|
210
210
|
) do
|
211
|
-
assert_select "div.
|
212
|
-
assert_select "div.
|
213
|
-
assert_select "div.
|
214
|
-
assert_select "div.
|
215
|
-
assert_select "div.
|
211
|
+
assert_select "div.span-6.sidebar" do
|
212
|
+
assert_select "div.span-6.last#main", "main sidebar"
|
213
|
+
assert_select "div.span-3", "three"
|
214
|
+
assert_select "div.span-2", "two"
|
215
|
+
assert_select "div.span-1.last", "one"
|
216
216
|
end
|
217
217
|
end
|
218
218
|
end
|
219
219
|
|
220
220
|
should "allow tag overriding" do
|
221
221
|
show_view %(<% column :tag => :section do %>content<% end %>) do
|
222
|
-
assert_select "section.
|
222
|
+
assert_select "section.span-24:not([tag=section])", "content"
|
223
223
|
end
|
224
224
|
end
|
225
225
|
end
|
data/viewaide.gemspec
CHANGED