elabs_matchers 0.0.7 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +3 -6
  3. data/{development.txt → development.md} +2 -2
  4. data/doc/ElabsMatchers/Helpers/Fixtures.html +46 -46
  5. data/doc/ElabsMatchers/Helpers/NormalizeKeys.html +45 -45
  6. data/doc/ElabsMatchers/Helpers/ReloadRecord.html +45 -45
  7. data/doc/ElabsMatchers/Helpers/SelectYearAndMonth.html +48 -48
  8. data/doc/ElabsMatchers/Helpers.html +40 -40
  9. data/doc/ElabsMatchers/Matchers/{Allow/AllowMatcher.html → BeValidWith/BeValidWithMatcher.html} +150 -85
  10. data/doc/ElabsMatchers/Matchers/BeValidWith.html +229 -0
  11. data/doc/ElabsMatchers/Matchers/ContainHash/ContainHashMatcher.html +80 -67
  12. data/doc/ElabsMatchers/Matchers/ContainHash.html +51 -51
  13. data/doc/ElabsMatchers/Matchers/HaveAttribute/HaveAttributeMatcher.html +108 -95
  14. data/doc/ElabsMatchers/Matchers/HaveAttribute.html +49 -49
  15. data/doc/ElabsMatchers/Matchers/HaveFields/HaveFieldsMatcher.html +103 -90
  16. data/doc/ElabsMatchers/Matchers/HaveFields.html +50 -50
  17. data/doc/ElabsMatchers/Matchers/HaveFlash/HaveFlashMatcher.html +108 -95
  18. data/doc/ElabsMatchers/Matchers/HaveFlash.html +57 -57
  19. data/doc/ElabsMatchers/Matchers/HaveFormErrorsOn/HaveFormErrorsOnMatcher.html +110 -97
  20. data/doc/ElabsMatchers/Matchers/HaveFormErrorsOn.html +49 -49
  21. data/doc/ElabsMatchers/Matchers/HaveHeader/HaveHeaderMatcher.html +103 -90
  22. data/doc/ElabsMatchers/Matchers/HaveHeader.html +49 -49
  23. data/doc/ElabsMatchers/Matchers/HaveImage/HaveImageMatcher.html +104 -91
  24. data/doc/ElabsMatchers/Matchers/HaveImage.html +49 -49
  25. data/doc/ElabsMatchers/Matchers/OnlyInclude/OnlyIncludeMatcher.html +79 -66
  26. data/doc/ElabsMatchers/Matchers/OnlyInclude.html +50 -50
  27. data/doc/ElabsMatchers/Matchers/Persist/PersistMatcher.html +134 -69
  28. data/doc/ElabsMatchers/Matchers/Persist.html +49 -49
  29. data/doc/ElabsMatchers/Matchers.html +42 -42
  30. data/doc/ElabsMatchers.html +143 -144
  31. data/doc/_index.html +35 -52
  32. data/doc/class_list.html +25 -27
  33. data/doc/css/full_list.css +32 -31
  34. data/doc/css/style.css +262 -91
  35. data/doc/file.README.html +91 -87
  36. data/doc/file_list.html +27 -26
  37. data/doc/frames.html +10 -21
  38. data/doc/index.html +91 -87
  39. data/doc/js/app.js +106 -72
  40. data/doc/js/full_list.js +170 -127
  41. data/doc/method_list.html +456 -505
  42. data/doc/top-level-namespace.html +36 -38
  43. data/elabs_matchers.gemspec +2 -2
  44. data/history.txt +11 -0
  45. data/lib/elabs_matchers/helpers/normalize_keys.rb +1 -1
  46. data/lib/elabs_matchers/helpers/select_year_and_month.rb +1 -0
  47. data/lib/elabs_matchers/matchers/be_valid_with.rb +5 -10
  48. data/lib/elabs_matchers/matchers/contain_hash.rb +4 -2
  49. data/lib/elabs_matchers/matchers/have_attribute.rb +5 -2
  50. data/lib/elabs_matchers/matchers/have_fields.rb +5 -2
  51. data/lib/elabs_matchers/matchers/have_flash.rb +5 -2
  52. data/lib/elabs_matchers/matchers/have_form_errors_on.rb +5 -2
  53. data/lib/elabs_matchers/matchers/have_header.rb +5 -2
  54. data/lib/elabs_matchers/matchers/have_image.rb +5 -2
  55. data/lib/elabs_matchers/matchers/only_include.rb +14 -2
  56. data/lib/elabs_matchers/matchers/persist.rb +8 -2
  57. data/lib/elabs_matchers/version.rb +1 -1
  58. data/lib/elabs_matchers.rb +0 -1
  59. data/spec/elabs_matchers/matchers/only_include_spec.rb +13 -0
  60. data/spec/elabs_matchers/matchers/persist_spec.rb +1 -1
  61. data/spec/spec_helper.rb +7 -0
  62. metadata +8 -29
  63. data/doc/Cucumber.html +0 -116
  64. data/doc/ElabsMatchers/Cucumber/Common.html +0 -145
  65. data/doc/ElabsMatchers/Cucumber.html +0 -108
  66. data/doc/ElabsMatchers/Helpers/Capybara.html +0 -241
  67. data/doc/ElabsMatchers/Helpers/Common.html +0 -213
  68. data/doc/ElabsMatchers/Helpers/Orm.html +0 -289
  69. data/doc/ElabsMatchers/Helpers/Session.html +0 -497
  70. data/doc/ElabsMatchers/Matchers/Allow.html +0 -229
  71. data/doc/ElabsMatchers/Matchers/Capybara/Common.html +0 -1159
  72. data/doc/ElabsMatchers/Matchers/Capybara.html +0 -108
  73. data/doc/ElabsMatchers/Matchers/HaveTableRow/HaveTableRowMatcher.html +0 -654
  74. data/doc/ElabsMatchers/Matchers/HaveTableRow.html +0 -236
  75. data/doc/ElabsMatchers/Matchers/Rspec/Allow.html +0 -98
  76. data/doc/ElabsMatchers/Matchers/Rspec/Common.html +0 -332
  77. data/doc/ElabsMatchers/Matchers/Rspec/Orm.html +0 -231
  78. data/doc/ElabsMatchers/Matchers/Rspec.html +0 -110
  79. data/doc/ElabsMatchers/Orm/Post.html +0 -1041
  80. data/doc/ElabsMatchers/Orm.html +0 -108
  81. data/lib/elabs_matchers/matchers/have_table_row.rb +0 -124
  82. data/spec/elabs_matchers/matchers/have_table_row_spec.rb +0 -119
@@ -1,229 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>
7
- Module: ElabsMatchers::Matchers::Allow
8
-
9
- &mdash; Documentation by YARD 0.8.2.1
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- hasFrames = window.top.frames.main ? true : false;
19
- relpath = '../../';
20
- framesUrl = "../../frames.html#!" + escape(window.location.href);
21
- </script>
22
-
23
-
24
- <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
-
26
- <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
-
28
-
29
- </head>
30
- <body>
31
- <div id="header">
32
- <div id="menu">
33
-
34
- <a href="../../_index.html">Index (A)</a> &raquo;
35
- <span class='title'><span class='object_link'><a href="../../ElabsMatchers.html" title="ElabsMatchers (module)">ElabsMatchers</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Matchers.html" title="ElabsMatchers::Matchers (module)">Matchers</a></span></span>
36
- &raquo;
37
- <span class="title">Allow</span>
38
-
39
-
40
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
- </div>
42
-
43
- <div id="search">
44
-
45
- <a class="full_list_link" id="class_list_link"
46
- href="../../class_list.html">
47
- Class List
48
- </a>
49
-
50
- <a class="full_list_link" id="method_list_link"
51
- href="../../method_list.html">
52
- Method List
53
- </a>
54
-
55
- <a class="full_list_link" id="file_list_link"
56
- href="../../file_list.html">
57
- File List
58
- </a>
59
-
60
- </div>
61
- <div class="clear"></div>
62
- </div>
63
-
64
- <iframe id="search_frame"></iframe>
65
-
66
- <div id="content"><h1>Module: ElabsMatchers::Matchers::Allow
67
-
68
-
69
-
70
- </h1>
71
-
72
- <dl class="box">
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
- <dt class="r1 last">Defined in:</dt>
82
- <dd class="r1 last">lib/elabs_matchers/matchers/allow.rb</dd>
83
-
84
- </dl>
85
- <div class="clear"></div>
86
-
87
- <h2>Defined Under Namespace</h2>
88
- <p class="children">
89
-
90
-
91
-
92
-
93
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="Allow/AllowMatcher.html" title="ElabsMatchers::Matchers::Allow::AllowMatcher (class)">AllowMatcher</a></span>
94
-
95
-
96
- </p>
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
- <h2>
106
- Instance Method Summary
107
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
108
- </h2>
109
-
110
- <ul class="summary">
111
-
112
- <li class="public ">
113
- <span class="summary_signature">
114
-
115
- <a href="#allow-instance_method" title="#allow (instance method)">- (Object) <strong>allow</strong>(*values) </a>
116
-
117
-
118
-
119
- </span>
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
- <span class="summary_desc"><div class='inline'>
130
- <p>Asserts if a sample value is valid on a given attribute.</p>
131
- </div></span>
132
-
133
- </li>
134
-
135
-
136
- </ul>
137
-
138
-
139
-
140
-
141
- <div id="instance_method_details" class="method_details_list">
142
- <h2>Instance Method Details</h2>
143
-
144
-
145
- <div class="method_details first">
146
- <h3 class="signature first" id="allow-instance_method">
147
-
148
- - (<tt>Object</tt>) <strong>allow</strong>(*values)
149
-
150
-
151
-
152
-
153
-
154
- </h3><div class="docstring">
155
- <div class="discussion">
156
-
157
- <p>Asserts if a sample value is valid on a given attribute</p>
158
-
159
- <p>Example: post.should allow("Elabs").as(:title) post.should_not
160
- allow("").as(:title)</p>
161
-
162
- <p>post.should allow("Elabs").as(:title, :body) post.should_not
163
- allow("").as(:title, :body)</p>
164
-
165
- <p>post.should allow("Elabs", "Sweden").as(:title) post.should_not allow("",
166
- nil).as(:title)</p>
167
-
168
- <p>post.should allow("Elabs", "Sweden").as(:title, :body) post.should_not
169
- allow("", nil).as(:title, :body)</p>
170
-
171
-
172
- </div>
173
- </div>
174
- <div class="tags">
175
- <p class="tag_title">Parameters:</p>
176
- <ul class="param">
177
-
178
- <li>
179
-
180
- <span class='name'>values</span>
181
-
182
-
183
- <span class='type'>(<tt>*Array</tt>)</span>
184
-
185
-
186
-
187
- &mdash;
188
- <div class='inline'>
189
- <p>Sample value(s) to check the validation against</p>
190
- </div>
191
-
192
- </li>
193
-
194
- </ul>
195
-
196
-
197
- </div><table class="source_code">
198
- <tr>
199
- <td>
200
- <pre class="lines">
201
-
202
-
203
- 124
204
- 125
205
- 126</pre>
206
- </td>
207
- <td>
208
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/matchers/allow.rb', line 124</span>
209
-
210
- <span class='kw'>def</span> <span class='id identifier rubyid_allow'>allow</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_values'>values</span><span class='rparen'>)</span>
211
- <span class='const'>AllowMatcher</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_values'>values</span><span class='rparen'>)</span>
212
- <span class='kw'>end</span></pre>
213
- </td>
214
- </tr>
215
- </table>
216
- </div>
217
-
218
- </div>
219
-
220
- </div>
221
-
222
- <div id="footer">
223
- Generated on Wed Sep 19 15:04:26 2012 by
224
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
225
- 0.8.2.1 (ruby-1.9.3).
226
- </div>
227
-
228
- </body>
229
- </html>
@@ -1,1159 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>
7
- Module: ElabsMatchers::Matchers::Capybara::Common
8
-
9
- &mdash; Documentation by YARD 0.7.5
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- relpath = '../../..';
19
- if (relpath != '') relpath += '/';
20
- </script>
21
-
22
- <script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
23
-
24
- <script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
25
-
26
-
27
- </head>
28
- <body>
29
- <script type="text/javascript" charset="utf-8">
30
- if (window.top.frames.main) document.body.className = 'frames';
31
- </script>
32
-
33
- <div id="header">
34
- <div id="menu">
35
-
36
- <a href="../../../_index.html">Index (C)</a> &raquo;
37
- <span class='title'><span class='object_link'><a href="../../../ElabsMatchers.html" title="ElabsMatchers (module)">ElabsMatchers</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Matchers.html" title="ElabsMatchers::Matchers (module)">Matchers</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Capybara.html" title="ElabsMatchers::Matchers::Capybara (module)">Capybara</a></span></span>
38
- &raquo;
39
- <span class="title">Common</span>
40
-
41
-
42
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
- </div>
44
-
45
- <div id="search">
46
-
47
- <a id="class_list_link" href="#">Class List</a>
48
-
49
- <a id="method_list_link" href="#">Method List</a>
50
-
51
- <a id="file_list_link" href="#">File List</a>
52
-
53
- </div>
54
- <div class="clear"></div>
55
- </div>
56
-
57
- <iframe id="search_frame"></iframe>
58
-
59
- <div id="content"><h1>Module: ElabsMatchers::Matchers::Capybara::Common
60
-
61
-
62
-
63
- </h1>
64
-
65
- <dl class="box">
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
- <dt class="r1 last">Defined in:</dt>
75
- <dd class="r1 last">lib/elabs_matchers/matchers/capybara/common.rb</dd>
76
-
77
- </dl>
78
- <div class="clear"></div>
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
- <h2>
89
- Instance Method Summary
90
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
91
- </h2>
92
-
93
- <ul class="summary">
94
-
95
- <li class="public ">
96
- <span class="summary_signature">
97
-
98
- <a href="#have_attribute-instance_method" title="#have_attribute (instance method)">- (Object) <strong>have_attribute</strong> </a>
99
-
100
-
101
-
102
- </span>
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
- <span class="summary_desc"><div class='inline'>
112
- <p>Asserts if the supplied show_for* attribute exists or not.</p>
113
- </div></span>
114
-
115
- </li>
116
-
117
-
118
- <li class="public ">
119
- <span class="summary_signature">
120
-
121
- <a href="#have_fields-instance_method" title="#have_fields (instance method)">- (Object) <strong>have_fields</strong> </a>
122
-
123
-
124
-
125
- </span>
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
- <span class="summary_desc"><div class='inline'>
135
- <p>Asserts if the supplied fields exists or not.</p>
136
- </div></span>
137
-
138
- </li>
139
-
140
-
141
- <li class="public ">
142
- <span class="summary_signature">
143
-
144
- <a href="#have_flash_alert-instance_method" title="#have_flash_alert (instance method)">- (Object) <strong>have_flash_alert</strong> </a>
145
-
146
-
147
-
148
- </span>
149
-
150
-
151
-
152
-
153
-
154
-
155
-
156
-
157
- <span class="summary_desc"><div class='inline'>
158
- <p>Asserts if the supplied flash alert exists or not.</p>
159
- </div></span>
160
-
161
- </li>
162
-
163
-
164
- <li class="public ">
165
- <span class="summary_signature">
166
-
167
- <a href="#have_flash_notice-instance_method" title="#have_flash_notice (instance method)">- (Object) <strong>have_flash_notice</strong> </a>
168
-
169
-
170
-
171
- </span>
172
-
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
- <span class="summary_desc"><div class='inline'>
181
- <p>Asserts if the supplied flash notice exists or not.</p>
182
- </div></span>
183
-
184
- </li>
185
-
186
-
187
- <li class="public ">
188
- <span class="summary_signature">
189
-
190
- <a href="#have_form_errors_on-instance_method" title="#have_form_errors_on (instance method)">- (Object) <strong>have_form_errors_on</strong> </a>
191
-
192
-
193
-
194
- </span>
195
-
196
-
197
-
198
-
199
-
200
-
201
-
202
-
203
- <span class="summary_desc"><div class='inline'>
204
- <p>Asserts if the supplied flash alert exists or not.</p>
205
- </div></span>
206
-
207
- </li>
208
-
209
-
210
- <li class="public ">
211
- <span class="summary_signature">
212
-
213
- <a href="#have_header-instance_method" title="#have_header (instance method)">- (Object) <strong>have_header</strong> </a>
214
-
215
-
216
-
217
- </span>
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
-
226
- <span class="summary_desc"><div class='inline'>
227
- <p>Asserts if the supplied header exists or not.</p>
228
- </div></span>
229
-
230
- </li>
231
-
232
-
233
- <li class="public ">
234
- <span class="summary_signature">
235
-
236
- <a href="#have_image-instance_method" title="#have_image (instance method)">- (Object) <strong>have_image</strong> </a>
237
-
238
-
239
-
240
- </span>
241
-
242
-
243
-
244
-
245
-
246
-
247
-
248
-
249
- <span class="summary_desc"><div class='inline'>
250
- <p>Asserts if the supplied image exists or not.</p>
251
- </div></span>
252
-
253
- </li>
254
-
255
-
256
- <li class="public ">
257
- <span class="summary_signature">
258
-
259
- <a href="#have_options-instance_method" title="#have_options (instance method)">- (Object) <strong>have_options</strong> </a>
260
-
261
-
262
-
263
- </span>
264
-
265
-
266
-
267
-
268
-
269
-
270
-
271
-
272
- <span class="summary_desc"><div class='inline'>
273
- <p>Asserts if the select input tag contains the given options.</p>
274
- </div></span>
275
-
276
- </li>
277
-
278
-
279
- <li class="public ">
280
- <span class="summary_signature">
281
-
282
- <a href="#have_table_row-instance_method" title="#have_table_row (instance method)">- (Object) <strong>have_table_row</strong> </a>
283
-
284
-
285
-
286
- </span>
287
-
288
-
289
-
290
-
291
-
292
-
293
-
294
-
295
- <span class="summary_desc"><div class='inline'>
296
- <p>Asserts if the supplied table row exists in the table.</p>
297
- </div></span>
298
-
299
- </li>
300
-
301
-
302
- </ul>
303
-
304
-
305
-
306
-
307
- <div id="instance_method_details" class="method_details_list">
308
- <h2>Instance Method Details</h2>
309
-
310
-
311
- <div class="method_details first">
312
- <p class="signature first" id="have_attribute-instance_method">
313
-
314
- - (<tt>Object</tt>) <strong>have_attribute</strong>
315
-
316
-
317
-
318
- </p><div class="docstring">
319
- <div class="discussion">
320
-
321
- <p>Asserts if the supplied show_for* attribute exists or not</p>
322
-
323
- <p>Example: page.should have_attribute("Status", "Pending")</p>
324
- <ul><li>
325
- <p><a
326
- href="https://github.com/plataformatec/show_for">github.com/plataformatec/show_for</a></p>
327
- </li></ul>
328
-
329
-
330
- </div>
331
- </div>
332
- <div class="tags">
333
- <h3>Parameters:</h3>
334
- <ul class="param">
335
-
336
- <li>
337
-
338
- <span class='name'>label</span>
339
-
340
-
341
- <span class='type'>(<tt>String</tt>)</span>
342
-
343
-
344
-
345
- &mdash;
346
- <div class='inline'>
347
- <p>The name of the attribute.</p>
348
- </div>
349
-
350
- </li>
351
-
352
- <li>
353
-
354
- <span class='name'>value</span>
355
-
356
-
357
- <span class='type'>(<tt>String</tt>)</span>
358
-
359
-
360
-
361
- &mdash;
362
- <div class='inline'>
363
- <p>The value of the attribute.</p>
364
- </div>
365
-
366
- </li>
367
-
368
- </ul>
369
-
370
-
371
- </div><table class="source_code">
372
- <tr>
373
- <td>
374
- <pre class="lines">
375
-
376
-
377
- 103
378
- 104
379
- 105
380
- 106
381
- 107
382
- 108
383
- 109
384
- 110
385
- 111
386
- 112
387
- 113
388
- 114
389
- 115
390
- 116
391
- 117
392
- 118
393
- 119</pre>
394
- </td>
395
- <td>
396
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/matchers/capybara/common.rb', line 103</span>
397
-
398
- <span class='const'>RSpec</span><span class='op'>::</span><span class='const'>Matchers</span><span class='period'>.</span><span class='id identifier rubyid_define'>define</span> <span class='symbol'>:have_attribute</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_label'>label</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
399
- <span class='id identifier rubyid_xpath'>xpath</span> <span class='op'>=</span> <span class='const'>XPath</span><span class='period'>.</span><span class='id identifier rubyid_generate'>generate</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_descendant'>descendant</span><span class='lparen'>(</span><span class='symbol'>:p</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_attr'>attr</span><span class='lparen'>(</span><span class='symbol'>:class</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_contains'>contains</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>wrapper</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_child'>child</span><span class='lparen'>(</span><span class='symbol'>:strong</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_contains'>contains</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_x'>x</span><span class='period'>.</span><span class='id identifier rubyid_contains'>contains</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
400
-
401
- <span class='id identifier rubyid_match'>match</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span>
402
- <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_has_xpath?'>has_xpath?</span><span class='lparen'>(</span><span class='id identifier rubyid_xpath'>xpath</span><span class='rparen'>)</span>
403
- <span class='kw'>end</span>
404
-
405
- <span class='id identifier rubyid_match_for_should_not'>match_for_should_not</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span>
406
- <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_has_no_xpath?'>has_no_xpath?</span><span class='lparen'>(</span><span class='id identifier rubyid_xpath'>xpath</span><span class='rparen'>)</span>
407
- <span class='kw'>end</span>
408
-
409
- <span class='id identifier rubyid_failure_message_for_should'>failure_message_for_should</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span>
410
- <span class='id identifier rubyid_attributes'>attributes</span> <span class='op'>=</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='symbol'>:css</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>li.wrapper</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:text</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_sentence'>to_sentence</span>
411
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected there to be an attribute </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='rbrace'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span><span class='tstring_content'>, but the only attributes were: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attributes'>attributes</span><span class='rbrace'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span>
412
- <span class='kw'>end</span>
413
- <span class='id identifier rubyid_failure_message_for_should_not'>failure_message_for_should_not</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected there to be no attribute </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='rbrace'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span><span class='tstring_content'>, but there was.</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span>
414
- <span class='kw'>end</span></pre>
415
- </td>
416
- </tr>
417
- </table>
418
- </div>
419
-
420
- <div class="method_details ">
421
- <p class="signature " id="have_fields-instance_method">
422
-
423
- - (<tt>Object</tt>) <strong>have_fields</strong>
424
-
425
-
426
-
427
- </p><div class="docstring">
428
- <div class="discussion">
429
-
430
- <p>Asserts if the supplied fields exists or not</p>
431
-
432
- <p>Example: page.should have_fields("Author" =&gt; "Adam", "Year" =&gt;
433
- "2011")</p>
434
-
435
-
436
- </div>
437
- </div>
438
- <div class="tags">
439
- <h3>Parameters:</h3>
440
- <ul class="param">
441
-
442
- <li>
443
-
444
- <span class='name'>field</span>
445
-
446
-
447
- <span class='type'>(<tt>Hash</tt>)</span>
448
-
449
-
450
-
451
- &mdash;
452
- <div class='inline'>
453
- <p>name, value A hash containing pairs of field name =&gt; value</p>
454
- </div>
455
-
456
- </li>
457
-
458
- </ul>
459
-
460
-
461
- </div><table class="source_code">
462
- <tr>
463
- <td>
464
- <pre class="lines">
465
-
466
-
467
- 230
468
- 231
469
- 232
470
- 233
471
- 234
472
- 235
473
- 236
474
- 237
475
- 238
476
- 239
477
- 240
478
- 241</pre>
479
- </td>
480
- <td>
481
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/matchers/capybara/common.rb', line 230</span>
482
-
483
- <span class='const'>RSpec</span><span class='op'>::</span><span class='const'>Matchers</span><span class='period'>.</span><span class='id identifier rubyid_define'>define</span> <span class='symbol'>:have_fields</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_fields'>fields</span><span class='op'>|</span>
484
- <span class='id identifier rubyid_match'>match</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span>
485
- <span class='id identifier rubyid_exps'>exps</span> <span class='op'>=</span> <span class='id identifier rubyid_fields'>fields</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_label'>label</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='const'>XPath</span><span class='op'>::</span><span class='const'>HTML</span><span class='period'>.</span><span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='comma'>,</span> <span class='symbol'>:with</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
486
- <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_has_xpath?'>has_xpath?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>(./html | ./self::*)[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_exps'>exps</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> and </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>]</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
487
- <span class='kw'>end</span>
488
- <span class='id identifier rubyid_match_for_should_not'>match_for_should_not</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span>
489
- <span class='id identifier rubyid_exps'>exps</span> <span class='op'>=</span> <span class='id identifier rubyid_fields'>fields</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_label'>label</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='const'>XPath</span><span class='op'>::</span><span class='const'>HTML</span><span class='period'>.</span><span class='id identifier rubyid_field'>field</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='comma'>,</span> <span class='symbol'>:with</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
490
- <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_has_no_xpath?'>has_no_xpath?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>(./html | ./self::*)[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_exps'>exps</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> and </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>]</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
491
- <span class='kw'>end</span>
492
- <span class='id identifier rubyid_failure_message_for_should'>failure_message_for_should</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected page to have the fields </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_fields'>fields</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'>, but it didn't.</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span>
493
- <span class='id identifier rubyid_failure_message_for_should_not'>failure_message_for_should_not</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected page not to have the fields </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_fields'>fields</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'>, but it did.</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span>
494
- <span class='kw'>end</span></pre>
495
- </td>
496
- </tr>
497
- </table>
498
- </div>
499
-
500
- <div class="method_details ">
501
- <p class="signature " id="have_flash_alert-instance_method">
502
-
503
- - (<tt>Object</tt>) <strong>have_flash_alert</strong>
504
-
505
-
506
-
507
- </p><div class="docstring">
508
- <div class="discussion">
509
-
510
- <p>Asserts if the supplied flash alert exists or not</p>
511
-
512
- <p>Example: page.should have_flash_alert("Error")</p>
513
-
514
-
515
- </div>
516
- </div>
517
- <div class="tags">
518
- <h3>Parameters:</h3>
519
- <ul class="param">
520
-
521
- <li>
522
-
523
- <span class='name'>text</span>
524
-
525
-
526
- <span class='type'>(<tt>String</tt>)</span>
527
-
528
-
529
-
530
- &mdash;
531
- <div class='inline'>
532
- <p>The content of the flash alert</p>
533
- </div>
534
-
535
- </li>
536
-
537
- </ul>
538
-
539
-
540
- </div><table class="source_code">
541
- <tr>
542
- <td>
543
- <pre class="lines">
544
-
545
-
546
- 186
547
- 187
548
- 188
549
- 189
550
- 190
551
- 191</pre>
552
- </td>
553
- <td>
554
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/matchers/capybara/common.rb', line 186</span>
555
-
556
- <span class='const'>RSpec</span><span class='op'>::</span><span class='const'>Matchers</span><span class='period'>.</span><span class='id identifier rubyid_define'>define</span> <span class='symbol'>:have_flash_alert</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_text'>text</span><span class='op'>|</span>
557
- <span class='id identifier rubyid_match'>match</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_has_css?'>has_css?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>#flash.alert, #flash .alert</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:text</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
558
- <span class='id identifier rubyid_match_for_should_not'>match_for_should_not</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_has_no_css?'>has_no_css?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>#flash.alert, #flash .alert</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:text</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
559
- <span class='id identifier rubyid_failure_message_for_should'>failure_message_for_should</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected flash alert to be '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_text'>text</span><span class='rbrace'>}</span><span class='tstring_content'>' but was '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>#flash.alert</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='rbrace'>}</span><span class='tstring_content'>'</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span>
560
- <span class='id identifier rubyid_failure_message_for_should_not'>failure_message_for_should_not</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected flash alert not to be '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_text'>text</span><span class='rbrace'>}</span><span class='tstring_content'>' but it was</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span>
561
- <span class='kw'>end</span></pre>
562
- </td>
563
- </tr>
564
- </table>
565
- </div>
566
-
567
- <div class="method_details ">
568
- <p class="signature " id="have_flash_notice-instance_method">
569
-
570
- - (<tt>Object</tt>) <strong>have_flash_notice</strong>
571
-
572
-
573
-
574
- </p><div class="docstring">
575
- <div class="discussion">
576
-
577
- <p>Asserts if the supplied flash notice exists or not</p>
578
-
579
- <p>Example: page.should have_flash_notice("Success")</p>
580
-
581
-
582
- </div>
583
- </div>
584
- <div class="tags">
585
- <h3>Parameters:</h3>
586
- <ul class="param">
587
-
588
- <li>
589
-
590
- <span class='name'>text</span>
591
-
592
-
593
- <span class='type'>(<tt>String</tt>)</span>
594
-
595
-
596
-
597
- &mdash;
598
- <div class='inline'>
599
- <p>The content of the flash notice</p>
600
- </div>
601
-
602
- </li>
603
-
604
- </ul>
605
-
606
-
607
- </div><table class="source_code">
608
- <tr>
609
- <td>
610
- <pre class="lines">
611
-
612
-
613
- 170
614
- 171
615
- 172
616
- 173
617
- 174
618
- 175</pre>
619
- </td>
620
- <td>
621
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/matchers/capybara/common.rb', line 170</span>
622
-
623
- <span class='const'>RSpec</span><span class='op'>::</span><span class='const'>Matchers</span><span class='period'>.</span><span class='id identifier rubyid_define'>define</span> <span class='symbol'>:have_flash_notice</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_text'>text</span><span class='op'>|</span>
624
- <span class='id identifier rubyid_match'>match</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_has_css?'>has_css?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>#flash.notice, #flash .notice</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:text</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
625
- <span class='id identifier rubyid_match_for_should_not'>match_for_should_not</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_has_no_css?'>has_no_css?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>#flash.notice, #flash .notice</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:text</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
626
- <span class='id identifier rubyid_failure_message_for_should'>failure_message_for_should</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected flash notice to be '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_text'>text</span><span class='rbrace'>}</span><span class='tstring_content'>' but was '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>#flash.notice</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='rbrace'>}</span><span class='tstring_content'>'</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span>
627
- <span class='id identifier rubyid_failure_message_for_should_not'>failure_message_for_should_not</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected flash notice not to be '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_text'>text</span><span class='rbrace'>}</span><span class='tstring_content'>' but it was</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span>
628
- <span class='kw'>end</span></pre>
629
- </td>
630
- </tr>
631
- </table>
632
- </div>
633
-
634
- <div class="method_details ">
635
- <p class="signature " id="have_form_errors_on-instance_method">
636
-
637
- - (<tt>Object</tt>) <strong>have_form_errors_on</strong>
638
-
639
-
640
-
641
- </p><div class="docstring">
642
- <div class="discussion">
643
-
644
- <p>Asserts if the supplied flash alert exists or not</p>
645
-
646
- <p>Example: page.should have_form_errors_on("Name", "Can't be blank")</p>
647
-
648
-
649
- </div>
650
- </div>
651
- <div class="tags">
652
- <h3>Parameters:</h3>
653
- <ul class="param">
654
-
655
- <li>
656
-
657
- <span class='name'>label</span>
658
-
659
-
660
- <span class='type'>(<tt>String</tt>)</span>
661
-
662
-
663
-
664
- &mdash;
665
- <div class='inline'>
666
- <p>The label content associated with the field.</p>
667
- </div>
668
-
669
- </li>
670
-
671
- <li>
672
-
673
- <span class='name'>message</span>
674
-
675
-
676
- <span class='type'>(<tt>String</tt>)</span>
677
-
678
-
679
-
680
- &mdash;
681
- <div class='inline'>
682
- <p>The error message expected.</p>
683
- </div>
684
-
685
- </li>
686
-
687
- </ul>
688
-
689
-
690
- </div><table class="source_code">
691
- <tr>
692
- <td>
693
- <pre class="lines">
694
-
695
-
696
- 203
697
- 204
698
- 205
699
- 206
700
- 207
701
- 208
702
- 209
703
- 210
704
- 211
705
- 212
706
- 213
707
- 214
708
- 215
709
- 216
710
- 217
711
- 218
712
- 219</pre>
713
- </td>
714
- <td>
715
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/matchers/capybara/common.rb', line 203</span>
716
-
717
- <span class='const'>RSpec</span><span class='op'>::</span><span class='const'>Matchers</span><span class='period'>.</span><span class='id identifier rubyid_define'>define</span> <span class='symbol'>:have_form_errors_on</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_field'>field</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='op'>|</span>
718
- <span class='id identifier rubyid_xpath'>xpath</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>%Q{</span><span class='tstring_content'>..//span[contains(@class,'error')]</span><span class='tstring_end'>}</span></span>
719
- <span class='id identifier rubyid_match'>match</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_has_field?'>has_field?</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span> <span class='kw'>and</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_find_field'>find_field</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_has_xpath?'>has_xpath?</span><span class='lparen'>(</span><span class='id identifier rubyid_xpath'>xpath</span><span class='comma'>,</span> <span class='symbol'>:text</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
720
- <span class='id identifier rubyid_match_for_should_not'>match_for_should_not</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_has_no_field?'>has_no_field?</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span> <span class='kw'>or</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_find_field'>find_field</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_has_no_xpath?'>has_no_xpath?</span><span class='lparen'>(</span><span class='id identifier rubyid_xpath'>xpath</span><span class='comma'>,</span> <span class='symbol'>:text</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
721
-
722
- <span class='id identifier rubyid_failure_message_for_should'>failure_message_for_should</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span>
723
- <span class='id identifier rubyid_error'>error</span> <span class='op'>=</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_find_field'>find_field</span><span class='lparen'>(</span><span class='id identifier rubyid_field'>field</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='symbol'>:xpath</span><span class='comma'>,</span> <span class='id identifier rubyid_xpath'>xpath</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
724
- <span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_error'>error</span>
725
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected field '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_field'>field</span><span class='rbrace'>}</span><span class='tstring_content'>' to have an error, but it didn't</span><span class='tstring_end'>&quot;</span></span>
726
- <span class='kw'>elsif</span> <span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span> <span class='op'>!=</span> <span class='id identifier rubyid_message'>message</span>
727
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected error message on </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_field'>field</span><span class='rbrace'>}</span><span class='tstring_content'> to be '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_message'>message</span><span class='rbrace'>}</span><span class='tstring_content'>' but was '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='rbrace'>}</span><span class='tstring_content'>'</span><span class='tstring_end'>&quot;</span></span>
728
- <span class='kw'>else</span>
729
- <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>This should not happen</span><span class='tstring_end'>&quot;</span></span>
730
- <span class='kw'>end</span>
731
- <span class='kw'>end</span>
732
- <span class='id identifier rubyid_failure_message_for_should_not'>failure_message_for_should_not</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected error message on '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_field'>field</span><span class='rbrace'>}</span><span class='tstring_content'>' not to be '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_text'>text</span><span class='rbrace'>}</span><span class='tstring_content'>' but it was</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span>
733
- <span class='kw'>end</span></pre>
734
- </td>
735
- </tr>
736
- </table>
737
- </div>
738
-
739
- <div class="method_details ">
740
- <p class="signature " id="have_header-instance_method">
741
-
742
- - (<tt>Object</tt>) <strong>have_header</strong>
743
-
744
-
745
-
746
- </p><div class="docstring">
747
- <div class="discussion">
748
-
749
- <p>Asserts if the supplied header exists or not</p>
750
-
751
- <p>Example: page.should have_header("Elabs")</p>
752
-
753
-
754
- </div>
755
- </div>
756
- <div class="tags">
757
- <h3>Parameters:</h3>
758
- <ul class="param">
759
-
760
- <li>
761
-
762
- <span class='name'>text</span>
763
-
764
-
765
- <span class='type'>(<tt>String</tt>)</span>
766
-
767
-
768
-
769
- &mdash;
770
- <div class='inline'>
771
- <p>The content of the header</p>
772
- </div>
773
-
774
- </li>
775
-
776
- </ul>
777
-
778
-
779
- </div><table class="source_code">
780
- <tr>
781
- <td>
782
- <pre class="lines">
783
-
784
-
785
- 150
786
- 151
787
- 152
788
- 153
789
- 154
790
- 155
791
- 156
792
- 157
793
- 158
794
- 159</pre>
795
- </td>
796
- <td>
797
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/matchers/capybara/common.rb', line 150</span>
798
-
799
- <span class='const'>RSpec</span><span class='op'>::</span><span class='const'>Matchers</span><span class='period'>.</span><span class='id identifier rubyid_define'>define</span> <span class='symbol'>:have_header</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_text'>text</span><span class='op'>|</span>
800
- <span class='id identifier rubyid_match'>match</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_has_css?'>has_css?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>h1,h2</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:text</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
801
- <span class='id identifier rubyid_match_for_should_not'>match_for_should_not</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_has_no_css?'>has_no_css?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>h1,h2</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:text</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
802
-
803
- <span class='id identifier rubyid_failure_message_for_should'>failure_message_for_should</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span>
804
- <span class='id identifier rubyid_headers'>headers</span> <span class='op'>=</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>h1,h2</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>'</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_h'>h</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='rbrace'>}</span><span class='tstring_content'>'</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_to_sentence'>to_sentence</span>
805
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected header to be '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_text'>text</span><span class='rbrace'>}</span><span class='tstring_content'>' but it had the headers </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_headers'>headers</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
806
- <span class='kw'>end</span>
807
- <span class='id identifier rubyid_failure_message_for_should_not'>failure_message_for_should_not</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected header not to be '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_text'>text</span><span class='rbrace'>}</span><span class='tstring_content'>' but it was</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span>
808
- <span class='kw'>end</span></pre>
809
- </td>
810
- </tr>
811
- </table>
812
- </div>
813
-
814
- <div class="method_details ">
815
- <p class="signature " id="have_image-instance_method">
816
-
817
- - (<tt>Object</tt>) <strong>have_image</strong>
818
-
819
-
820
-
821
- </p><div class="docstring">
822
- <div class="discussion">
823
-
824
- <p>Asserts if the supplied image exists or not</p>
825
-
826
- <p>Example: page.should have_image("Logo")</p>
827
-
828
-
829
- </div>
830
- </div>
831
- <div class="tags">
832
- <h3>Parameters:</h3>
833
- <ul class="param">
834
-
835
- <li>
836
-
837
- <span class='name'>alt</span>
838
-
839
-
840
- <span class='type'>(<tt>String</tt>)</span>
841
-
842
-
843
-
844
- &mdash;
845
- <div class='inline'>
846
- <p>The alt attribute content of the image</p>
847
- </div>
848
-
849
- </li>
850
-
851
- </ul>
852
-
853
-
854
- </div><table class="source_code">
855
- <tr>
856
- <td>
857
- <pre class="lines">
858
-
859
-
860
- 130
861
- 131
862
- 132
863
- 133
864
- 134
865
- 135
866
- 136
867
- 137
868
- 138
869
- 139</pre>
870
- </td>
871
- <td>
872
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/matchers/capybara/common.rb', line 130</span>
873
-
874
- <span class='const'>RSpec</span><span class='op'>::</span><span class='const'>Matchers</span><span class='period'>.</span><span class='id identifier rubyid_define'>define</span> <span class='symbol'>:have_image</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_alt'>alt</span><span class='op'>|</span>
875
- <span class='id identifier rubyid_match'>match</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_has_css?'>has_css?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>img[alt=\&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_alt'>alt</span><span class='rbrace'>}</span><span class='tstring_content'>\&quot;]</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='rbrace'>}</span>
876
- <span class='id identifier rubyid_match_for_should_not'>match_for_should_not</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_has_no_css?'>has_no_css?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>img[alt=\&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_alt'>alt</span><span class='rbrace'>}</span><span class='tstring_content'>\&quot;]</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='rbrace'>}</span>
877
-
878
- <span class='id identifier rubyid_failure_message_for_should'>failure_message_for_should</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span>
879
- <span class='id identifier rubyid_alts'>alts</span> <span class='op'>=</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>img</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_img'>img</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>'</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_img'>img</span><span class='lbracket'>[</span><span class='symbol'>:alt</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>'</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_to_sentence'>to_sentence</span>
880
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected image alt to be '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_alt'>alt</span><span class='rbrace'>}</span><span class='tstring_content'>' but it had the image alts: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_alts'>alts</span><span class='rbrace'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span>
881
- <span class='kw'>end</span>
882
- <span class='id identifier rubyid_failure_message_for_should_not'>failure_message_for_should_not</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected image not to be '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_alt'>alt</span><span class='rbrace'>}</span><span class='tstring_content'>' but it was</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span>
883
- <span class='kw'>end</span></pre>
884
- </td>
885
- </tr>
886
- </table>
887
- </div>
888
-
889
- <div class="method_details ">
890
- <p class="signature " id="have_options-instance_method">
891
-
892
- - (<tt>Object</tt>) <strong>have_options</strong>
893
-
894
-
895
-
896
- </p><div class="docstring">
897
- <div class="discussion">
898
-
899
- <p>Asserts if the select input tag contains the given options.</p>
900
-
901
- <p>Example: find(:xpath, XPath::HTML.select("My input label")).should
902
- have_options(options)</p>
903
-
904
-
905
- </div>
906
- </div>
907
- <div class="tags">
908
- <h3>Parameters:</h3>
909
- <ul class="param">
910
-
911
- <li>
912
-
913
- <span class='name'>options</span>
914
-
915
-
916
- <span class='type'>(<tt>Array</tt>)</span>
917
-
918
-
919
-
920
- &mdash;
921
- <div class='inline'>
922
- <p>One or serveral strings seperated by comma</p>
923
- </div>
924
-
925
- </li>
926
-
927
- </ul>
928
-
929
-
930
- </div><table class="source_code">
931
- <tr>
932
- <td>
933
- <pre class="lines">
934
-
935
-
936
- 14
937
- 15
938
- 16
939
- 17
940
- 18
941
- 19
942
- 20
943
- 21
944
- 22
945
- 23
946
- 24</pre>
947
- </td>
948
- <td>
949
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/matchers/capybara/common.rb', line 14</span>
950
-
951
- <span class='const'>RSpec</span><span class='op'>::</span><span class='const'>Matchers</span><span class='period'>.</span><span class='id identifier rubyid_define'>define</span> <span class='symbol'>:have_options</span> <span class='kw'>do</span> <span class='op'>|</span><span class='op'>*</span><span class='id identifier rubyid_options'>options</span><span class='op'>|</span>
952
- <span class='id identifier rubyid_match'>match</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_select'>select</span><span class='op'>|</span>
953
- <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_option'>option</span><span class='op'>|</span> <span class='id identifier rubyid_select'>select</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>option</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:text</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_option'>option</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
954
- <span class='kw'>end</span>
955
-
956
- <span class='id identifier rubyid_failure_message_for_should'>failure_message_for_should</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_select'>select</span><span class='op'>|</span>
957
- <span class='id identifier rubyid_actual_options'>actual_options</span> <span class='op'>=</span> <span class='id identifier rubyid_select'>select</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>option</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:text</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span>
958
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected options to include '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'>' but it had the options </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_actual_options'>actual_options</span><span class='rbrace'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span>
959
- <span class='kw'>end</span>
960
- <span class='id identifier rubyid_failure_message_for_should_not'>failure_message_for_should_not</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_select'>select</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected options not to include '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'>' but it did.</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span>
961
- <span class='kw'>end</span></pre>
962
- </td>
963
- </tr>
964
- </table>
965
- </div>
966
-
967
- <div class="method_details ">
968
- <p class="signature " id="have_table_row-instance_method">
969
-
970
- - (<tt>Object</tt>) <strong>have_table_row</strong>
971
-
972
-
973
-
974
- </p><div class="docstring">
975
- <div class="discussion">
976
-
977
- <p>Asserts if the supplied table row exists in the table</p>
978
-
979
- <p>Example: table.should have_table_row('Posts', "Title" =&gt; "First", :year
980
- =&gt; "2012")</p>
981
-
982
-
983
- </div>
984
- </div>
985
- <div class="tags">
986
- <h3>Parameters:</h3>
987
- <ul class="param">
988
-
989
- <li>
990
-
991
- <span class='name'>table</span>
992
-
993
-
994
- <span class='type'>(<tt>String</tt>)</span>
995
-
996
-
997
-
998
- &mdash;
999
- <div class='inline'>
1000
- <p>name The tables's caption text.</p>
1001
- </div>
1002
-
1003
- </li>
1004
-
1005
- <li>
1006
-
1007
- <span class='name'>column</span>
1008
-
1009
-
1010
- <span class='type'>(<tt>Hash</tt>)</span>
1011
-
1012
-
1013
-
1014
- &mdash;
1015
- <div class='inline'>
1016
- <p>value A hash representing the column name and value in key-value
1017
- form.</p>
1018
- </div>
1019
-
1020
- </li>
1021
-
1022
- </ul>
1023
-
1024
-
1025
- </div><table class="source_code">
1026
- <tr>
1027
- <td>
1028
- <pre class="lines">
1029
-
1030
-
1031
- 36
1032
- 37
1033
- 38
1034
- 39
1035
- 40
1036
- 41
1037
- 42
1038
- 43
1039
- 44
1040
- 45
1041
- 46
1042
- 47
1043
- 48
1044
- 49
1045
- 50
1046
- 51
1047
- 52
1048
- 53
1049
- 54
1050
- 55
1051
- 56
1052
- 57
1053
- 58
1054
- 59
1055
- 60
1056
- 61
1057
- 62
1058
- 63
1059
- 64
1060
- 65
1061
- 66
1062
- 67
1063
- 68
1064
- 69
1065
- 70
1066
- 71
1067
- 72
1068
- 73
1069
- 74
1070
- 75
1071
- 76
1072
- 77
1073
- 78
1074
- 79
1075
- 80
1076
- 81
1077
- 82
1078
- 83
1079
- 84
1080
- 85
1081
- 86
1082
- 87
1083
- 88
1084
- 89</pre>
1085
- </td>
1086
- <td>
1087
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/matchers/capybara/common.rb', line 36</span>
1088
-
1089
- <span class='const'>RSpec</span><span class='op'>::</span><span class='const'>Matchers</span><span class='period'>.</span><span class='id identifier rubyid_define'>define</span> <span class='symbol'>:have_table_row</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_table_name'>table_name</span><span class='comma'>,</span> <span class='id identifier rubyid_row'>row</span><span class='op'>|</span>
1090
- <span class='id identifier rubyid_match'>match</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span>
1091
- <span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='symbol'>:xpath</span><span class='comma'>,</span> <span class='const'>XPath</span><span class='op'>::</span><span class='const'>HTML</span><span class='period'>.</span><span class='id identifier rubyid_table'>table</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span><span class='rparen'>)</span>
1092
-
1093
- <span class='kw'>if</span> <span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Hash</span>
1094
- <span class='id identifier rubyid_exps'>exps</span> <span class='op'>=</span> <span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_header'>header</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
1095
- <span class='id identifier rubyid_col_index'>col_index</span> <span class='op'>=</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>thead th</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_th'>th</span><span class='op'>|</span> <span class='id identifier rubyid_th'>th</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_header'>header</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
1096
- <span class='id identifier rubyid_col_index'>col_index</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_col_index'>col_index</span> <span class='kw'>then</span> <span class='id identifier rubyid_col_index'>col_index</span> <span class='op'>+</span> <span class='int'>1</span> <span class='kw'>else</span> <span class='int'>0</span> <span class='kw'>end</span>
1097
- <span class='const'>XPath</span><span class='period'>.</span><span class='id identifier rubyid_child'>child</span><span class='lparen'>(</span><span class='symbol'>:td</span><span class='comma'>,</span> <span class='symbol'>:th</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='id identifier rubyid_col_index'>col_index</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='const'>XPath</span><span class='period'>.</span><span class='id identifier rubyid_contains'>contains</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='rbracket'>]</span>
1098
- <span class='kw'>end</span>
1099
- <span class='id identifier rubyid_exps'>exps</span> <span class='op'>=</span> <span class='id identifier rubyid_exps'>exps</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_agg'>agg</span><span class='comma'>,</span> <span class='id identifier rubyid_exp'>exp</span><span class='op'>|</span> <span class='id identifier rubyid_agg'>agg</span> <span class='op'>&amp;</span> <span class='id identifier rubyid_exp'>exp</span> <span class='rbrace'>}</span>
1100
- <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_has_xpath?'>has_xpath?</span><span class='lparen'>(</span><span class='const'>XPath</span><span class='period'>.</span><span class='id identifier rubyid_descendant'>descendant</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>tr</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_exps'>exps</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1101
- <span class='kw'>else</span>
1102
- <span class='id identifier rubyid_exps'>exps</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1103
- <span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='op'>|</span>
1104
- <span class='id identifier rubyid_exps'>exps</span> <span class='op'>&lt;&lt;</span> <span class='const'>XPath</span><span class='period'>.</span><span class='id identifier rubyid_child'>child</span><span class='lparen'>(</span><span class='symbol'>:td</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='const'>XPath</span><span class='period'>.</span><span class='id identifier rubyid_contains'>contains</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='rbracket'>]</span>
1105
- <span class='kw'>end</span>
1106
- <span class='id identifier rubyid_exps'>exps</span> <span class='op'>=</span> <span class='id identifier rubyid_exps'>exps</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_agg'>agg</span><span class='comma'>,</span> <span class='id identifier rubyid_exp'>exp</span><span class='op'>|</span> <span class='id identifier rubyid_agg'>agg</span> <span class='op'>&amp;</span> <span class='id identifier rubyid_exp'>exp</span> <span class='rbrace'>}</span>
1107
-
1108
- <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_has_xpath?'>has_xpath?</span><span class='lparen'>(</span><span class='const'>XPath</span><span class='period'>.</span><span class='id identifier rubyid_descendant'>descendant</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>tr</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_exps'>exps</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1109
- <span class='kw'>end</span>
1110
- <span class='kw'>end</span>
1111
-
1112
- <span class='id identifier rubyid_match_for_should_not'>match_for_should_not</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span>
1113
- <span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='symbol'>:xpath</span><span class='comma'>,</span> <span class='const'>XPath</span><span class='op'>::</span><span class='const'>HTML</span><span class='period'>.</span><span class='id identifier rubyid_table'>table</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span><span class='rparen'>)</span>
1114
-
1115
- <span class='kw'>if</span> <span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Hash</span>
1116
- <span class='id identifier rubyid_exps'>exps</span> <span class='op'>=</span> <span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_header'>header</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
1117
- <span class='id identifier rubyid_col_index'>col_index</span> <span class='op'>=</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>thead th</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_th'>th</span><span class='op'>|</span> <span class='id identifier rubyid_th'>th</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_header'>header</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
1118
- <span class='id identifier rubyid_col_index'>col_index</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_col_index'>col_index</span> <span class='kw'>then</span> <span class='id identifier rubyid_col_index'>col_index</span> <span class='op'>+</span> <span class='int'>1</span> <span class='kw'>else</span> <span class='int'>0</span> <span class='kw'>end</span>
1119
- <span class='const'>XPath</span><span class='period'>.</span><span class='id identifier rubyid_child'>child</span><span class='lparen'>(</span><span class='symbol'>:td</span><span class='comma'>,</span> <span class='symbol'>:th</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='id identifier rubyid_col_index'>col_index</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='const'>XPath</span><span class='period'>.</span><span class='id identifier rubyid_contains'>contains</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='rbracket'>]</span>
1120
- <span class='kw'>end</span>
1121
- <span class='id identifier rubyid_exps'>exps</span> <span class='op'>=</span> <span class='id identifier rubyid_exps'>exps</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_agg'>agg</span><span class='comma'>,</span> <span class='id identifier rubyid_exp'>exp</span><span class='op'>|</span> <span class='id identifier rubyid_agg'>agg</span> <span class='op'>&amp;</span> <span class='id identifier rubyid_exp'>exp</span> <span class='rbrace'>}</span>
1122
- <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_has_no_xpath?'>has_no_xpath?</span><span class='lparen'>(</span><span class='const'>XPath</span><span class='period'>.</span><span class='id identifier rubyid_descendant'>descendant</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>tr</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_exps'>exps</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1123
- <span class='kw'>else</span>
1124
- <span class='id identifier rubyid_exps'>exps</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1125
- <span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='op'>|</span>
1126
- <span class='id identifier rubyid_exps'>exps</span> <span class='op'>&lt;&lt;</span> <span class='const'>XPath</span><span class='period'>.</span><span class='id identifier rubyid_child'>child</span><span class='lparen'>(</span><span class='symbol'>:td</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='const'>XPath</span><span class='period'>.</span><span class='id identifier rubyid_contains'>contains</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='rbracket'>]</span>
1127
- <span class='kw'>end</span>
1128
- <span class='id identifier rubyid_exps'>exps</span> <span class='op'>=</span> <span class='id identifier rubyid_exps'>exps</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_agg'>agg</span><span class='comma'>,</span> <span class='id identifier rubyid_exp'>exp</span><span class='op'>|</span> <span class='id identifier rubyid_agg'>agg</span> <span class='op'>&amp;</span> <span class='id identifier rubyid_exp'>exp</span> <span class='rbrace'>}</span>
1129
-
1130
- <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_has_no_xpath?'>has_no_xpath?</span><span class='lparen'>(</span><span class='const'>XPath</span><span class='period'>.</span><span class='id identifier rubyid_descendant'>descendant</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>tr</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_exps'>exps</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1131
- <span class='kw'>end</span>
1132
- <span class='kw'>end</span>
1133
-
1134
- <span class='id identifier rubyid_failure_message_for_should'>failure_message_for_should</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span>
1135
- <span class='id identifier rubyid_table'>table</span> <span class='op'>=</span> <span class='id identifier rubyid_page'>page</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='symbol'>:xpath</span><span class='comma'>,</span> <span class='const'>XPath</span><span class='op'>::</span><span class='const'>HTML</span><span class='period'>.</span><span class='id identifier rubyid_table'>table</span><span class='lparen'>(</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rparen'>)</span><span class='rparen'>)</span>
1136
- <span class='id identifier rubyid_ascii_table'>ascii_table</span> <span class='op'>=</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>tr</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_tr'>tr</span><span class='op'>|</span>
1137
- <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>| </span><span class='tstring_end'>'</span></span> <span class='op'>+</span> <span class='id identifier rubyid_tr'>tr</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>td,th</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_td'>td</span><span class='op'>|</span> <span class='id identifier rubyid_td'>td</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='int'>21</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> | </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> |</span><span class='tstring_end'>'</span></span>
1138
- <span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1139
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'> to be included in the table </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rbrace'>}</span><span class='tstring_content'>, but it wasn't:\n\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ascii_table'>ascii_table</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
1140
- <span class='kw'>end</span>
1141
- <span class='id identifier rubyid_failure_message_for_should_not'>failure_message_for_should_not</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_page'>page</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>expected there to be no table </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_table_name'>table_name</span><span class='rbrace'>}</span><span class='tstring_content'> with row </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'>, but there was.</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span>
1142
- <span class='kw'>end</span></pre>
1143
- </td>
1144
- </tr>
1145
- </table>
1146
- </div>
1147
-
1148
- </div>
1149
-
1150
- </div>
1151
-
1152
- <div id="footer">
1153
- Generated on Fri Feb 17 16:29:16 2012 by
1154
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1155
- 0.7.5 (ruby-1.9.3).
1156
- </div>
1157
-
1158
- </body>
1159
- </html>