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,289 +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::Helpers::Orm
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 (O)</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="../Helpers.html" title="ElabsMatchers::Helpers (module)">Helpers</a></span></span>
38
- &raquo;
39
- <span class="title">Orm</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::Helpers::Orm
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/helpers/orm.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="#reload-instance_method" title="#reload (instance method)">- (Object) <strong>reload</strong>(model) </a>
99
-
100
-
101
-
102
- </span>
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
- <span class="summary_desc"><div class='inline'>
112
- <p>Finds the record from the database and return a new instance for that
113
- record.</p>
114
- </div></span>
115
-
116
- </li>
117
-
118
-
119
- <li class="public ">
120
- <span class="summary_signature">
121
-
122
- <a href="#save_and_reload-instance_method" title="#save_and_reload (instance method)">- (Object) <strong>save_and_reload</strong>(model) </a>
123
-
124
-
125
-
126
- </span>
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
- <span class="summary_desc"><div class='inline'>
136
- <p>Saves the record and fetches it from the database and return a new instance
137
- for that record.</p>
138
- </div></span>
139
-
140
- </li>
141
-
142
-
143
- </ul>
144
-
145
-
146
-
147
-
148
- <div id="instance_method_details" class="method_details_list">
149
- <h2>Instance Method Details</h2>
150
-
151
-
152
- <div class="method_details first">
153
- <p class="signature first" id="reload-instance_method">
154
-
155
- - (<tt>Object</tt>) <strong>reload</strong>(model)
156
-
157
-
158
-
159
- </p><div class="docstring">
160
- <div class="discussion">
161
-
162
- <p>Finds the record from the database and return a new instance for that
163
- record.</p>
164
-
165
- <p>Example: reload(post)</p>
166
-
167
-
168
- </div>
169
- </div>
170
- <div class="tags">
171
- <h3>Parameters:</h3>
172
- <ul class="param">
173
-
174
- <li>
175
-
176
- <span class='name'>record</span>
177
-
178
-
179
- <span class='type'>(<tt>Object</tt>)</span>
180
-
181
-
182
-
183
- &mdash;
184
- <div class='inline'>
185
- <p>An instance of an ORM record</p>
186
- </div>
187
-
188
- </li>
189
-
190
- </ul>
191
-
192
-
193
- </div><table class="source_code">
194
- <tr>
195
- <td>
196
- <pre class="lines">
197
-
198
-
199
- 13
200
- 14
201
- 15</pre>
202
- </td>
203
- <td>
204
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/helpers/orm.rb', line 13</span>
205
-
206
- <span class='kw'>def</span> <span class='id identifier rubyid_reload'>reload</span><span class='lparen'>(</span><span class='id identifier rubyid_model'>model</span><span class='rparen'>)</span>
207
- <span class='id identifier rubyid_model'>model</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='id identifier rubyid_model'>model</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
208
- <span class='kw'>end</span></pre>
209
- </td>
210
- </tr>
211
- </table>
212
- </div>
213
-
214
- <div class="method_details ">
215
- <p class="signature " id="save_and_reload-instance_method">
216
-
217
- - (<tt>Object</tt>) <strong>save_and_reload</strong>(model)
218
-
219
-
220
-
221
- </p><div class="docstring">
222
- <div class="discussion">
223
-
224
- <p>Saves the record and fetches it from the database and return a new instance
225
- for that record.</p>
226
-
227
- <p>Example: save_and_reload(post)</p>
228
-
229
-
230
- </div>
231
- </div>
232
- <div class="tags">
233
- <h3>Parameters:</h3>
234
- <ul class="param">
235
-
236
- <li>
237
-
238
- <span class='name'>record</span>
239
-
240
-
241
- <span class='type'>(<tt>Object</tt>)</span>
242
-
243
-
244
-
245
- &mdash;
246
- <div class='inline'>
247
- <p>An instance of an ORM record</p>
248
- </div>
249
-
250
- </li>
251
-
252
- </ul>
253
-
254
-
255
- </div><table class="source_code">
256
- <tr>
257
- <td>
258
- <pre class="lines">
259
-
260
-
261
- 26
262
- 27
263
- 28
264
- 29</pre>
265
- </td>
266
- <td>
267
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/helpers/orm.rb', line 26</span>
268
-
269
- <span class='kw'>def</span> <span class='id identifier rubyid_save_and_reload'>save_and_reload</span><span class='lparen'>(</span><span class='id identifier rubyid_model'>model</span><span class='rparen'>)</span>
270
- <span class='id identifier rubyid_model'>model</span><span class='period'>.</span><span class='id identifier rubyid_save!'>save!</span>
271
- <span class='id identifier rubyid_reload'>reload</span><span class='lparen'>(</span><span class='id identifier rubyid_model'>model</span><span class='rparen'>)</span>
272
- <span class='kw'>end</span></pre>
273
- </td>
274
- </tr>
275
- </table>
276
- </div>
277
-
278
- </div>
279
-
280
- </div>
281
-
282
- <div id="footer">
283
- Generated on Fri Feb 17 16:29:16 2012 by
284
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
285
- 0.7.5 (ruby-1.9.3).
286
- </div>
287
-
288
- </body>
289
- </html>
@@ -1,497 +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::Helpers::Session
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 (S)</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="../Helpers.html" title="ElabsMatchers::Helpers (module)">Helpers</a></span></span>
38
- &raquo;
39
- <span class="title">Session</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::Helpers::Session
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/helpers/session.rb</dd>
76
-
77
- </dl>
78
- <div class="clear"></div>
79
-
80
-
81
-
82
-
83
-
84
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
85
- <ul class="summary">
86
-
87
- <li class="public ">
88
- <span class="summary_signature">
89
-
90
- <a href="#current_user-instance_method" title="#current_user (instance method)">- (Object) <strong>current_user</strong> </a>
91
-
92
-
93
-
94
- </span>
95
-
96
-
97
- <span class="note title readonly">readonly</span>
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
- <span class="summary_desc"><div class='inline'>
107
- <p>Can be used to keep track of the current signed in user.</p>
108
- </div></span>
109
-
110
- </li>
111
-
112
-
113
- </ul>
114
-
115
-
116
-
117
-
118
-
119
- <h2>
120
- Instance Method Summary
121
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
122
- </h2>
123
-
124
- <ul class="summary">
125
-
126
- <li class="public deprecated">
127
- <span class="summary_signature">
128
-
129
- <a href="#login_as-instance_method" title="#login_as (instance method)">- (Object) <strong>login_as</strong>(user) </a>
130
-
131
-
132
-
133
- </span>
134
-
135
-
136
-
137
-
138
- <span class="deprecated note title">Deprecated</span>
139
-
140
-
141
-
142
- <span class="summary_desc"><strong>Deprecated.</strong> <div class='inline'>
143
- <p>Please use sign_in instead</p>
144
- </div></span>
145
-
146
- </li>
147
-
148
-
149
- <li class="public ">
150
- <span class="summary_signature">
151
-
152
- <a href="#sign_in_as-instance_method" title="#sign_in_as (instance method)">- (Object) <strong>sign_in_as</strong>(user = nil) </a>
153
-
154
-
155
-
156
- (also: #sign_in)
157
-
158
- </span>
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
- <span class="summary_desc"><div class='inline'>
168
- <p>Set's a global variable that can be used to fake authentication when
169
- running acceptance tests.</p>
170
- </div></span>
171
-
172
- </li>
173
-
174
-
175
- <li class="public ">
176
- <span class="summary_signature">
177
-
178
- <a href="#sign_out-instance_method" title="#sign_out (instance method)">- (Object) <strong>sign_out</strong> </a>
179
-
180
-
181
-
182
- </span>
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
- <span class="summary_desc"><div class='inline'>
192
- <p>See sign_in for details.</p>
193
- </div></span>
194
-
195
- </li>
196
-
197
-
198
- </ul>
199
-
200
-
201
-
202
- <div id="instance_attr_details" class="attr_details">
203
- <h2>Instance Attribute Details</h2>
204
-
205
-
206
- <span id=""></span>
207
- <span id="current_user-instance_method"></span>
208
- <div class="method_details first">
209
- <p class="signature first" id="current_user-instance_method">
210
-
211
- - (<tt>Object</tt>) <strong>current_user</strong> <span class="extras">(readonly)</span>
212
-
213
-
214
-
215
- </p><div class="docstring">
216
- <div class="discussion">
217
-
218
- <p>Can be used to keep track of the current signed in user. If you use
219
- signed_in_as(user) this will be done automaticly.</p>
220
-
221
-
222
- </div>
223
- </div>
224
- <div class="tags">
225
-
226
-
227
- </div><table class="source_code">
228
- <tr>
229
- <td>
230
- <pre class="lines">
231
-
232
-
233
- 8
234
- 9
235
- 10</pre>
236
- </td>
237
- <td>
238
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/helpers/session.rb', line 8</span>
239
-
240
- <span class='kw'>def</span> <span class='id identifier rubyid_current_user'>current_user</span>
241
- <span class='ivar'>@current_user</span>
242
- <span class='kw'>end</span></pre>
243
- </td>
244
- </tr>
245
- </table>
246
- </div>
247
-
248
- </div>
249
-
250
-
251
- <div id="instance_method_details" class="method_details_list">
252
- <h2>Instance Method Details</h2>
253
-
254
-
255
- <div class="method_details first">
256
- <p class="signature first" id="login_as-instance_method">
257
-
258
- - (<tt>Object</tt>) <strong>login_as</strong>(user)
259
-
260
-
261
-
262
- </p><div class="docstring">
263
- <div class="discussion">
264
- <div class="note deprecated"><strong>Deprecated.</strong> <div class='inline'>
265
- <p>Please use sign_in instead</p>
266
- </div></div>
267
-
268
- <p>Logs the user into the system. Requires that you login with an email and
269
- password and that your fields are named a certain way as well as there
270
- being a new_user_session path available.</p>
271
-
272
- <p>Example: login_as(user)</p>
273
-
274
-
275
- </div>
276
- </div>
277
- <div class="tags">
278
- <h3>Parameters:</h3>
279
- <ul class="param">
280
-
281
- <li>
282
-
283
- <span class='name'>record</span>
284
-
285
-
286
- <span class='type'>(<tt>Object</tt>)</span>
287
-
288
-
289
-
290
- &mdash;
291
- <div class='inline'>
292
- <p>The user record</p>
293
- </div>
294
-
295
- </li>
296
-
297
- </ul>
298
-
299
-
300
- </div><table class="source_code">
301
- <tr>
302
- <td>
303
- <pre class="lines">
304
-
305
-
306
- 21
307
- 22
308
- 23
309
- 24
310
- 25
311
- 26
312
- 27
313
- 28
314
- 29</pre>
315
- </td>
316
- <td>
317
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/helpers/session.rb', line 21</span>
318
-
319
- <span class='kw'>def</span> <span class='id identifier rubyid_login_as'>login_as</span><span class='lparen'>(</span><span class='id identifier rubyid_user'>user</span><span class='rparen'>)</span>
320
- <span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[DEPRECATION] `login_as(user)` is deprecated. Please use `sign_in` instead.</span><span class='tstring_end'>&quot;</span></span>
321
-
322
- <span class='id identifier rubyid_visit'>visit</span><span class='lparen'>(</span><span class='id identifier rubyid_new_user_session_path'>new_user_session_path</span><span class='rparen'>)</span>
323
- <span class='id identifier rubyid_fill_in'>fill_in</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Email</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:with</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_email'>email</span><span class='rparen'>)</span>
324
- <span class='id identifier rubyid_fill_in'>fill_in</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Password</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:with</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_password'>password</span><span class='rparen'>)</span>
325
- <span class='id identifier rubyid_click_button'>click_button</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Sign in</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
326
- <span class='ivar'>@current_user</span> <span class='op'>=</span> <span class='id identifier rubyid_user'>user</span>
327
- <span class='kw'>end</span></pre>
328
- </td>
329
- </tr>
330
- </table>
331
- </div>
332
-
333
- <div class="method_details ">
334
- <p class="signature " id="sign_in_as-instance_method">
335
-
336
- - (<tt>Object</tt>) <strong>sign_in_as</strong>(user = nil)
337
-
338
-
339
-
340
- <span class="aliases">Also known as:
341
- <span class="names"><span id='sign_in-instance_method'>sign_in</span></span>
342
- </span>
343
-
344
- </p><div class="docstring">
345
- <div class="discussion">
346
-
347
- <p>Set's a global variable that can be used to fake authentication when
348
- running acceptance tests. This is much faster then using the sign in form
349
- everytime but requires you to make a small change to your application code.
350
- Please see [View source] for details.</p>
351
-
352
- <p>Example: sign_in_as(user)</p>
353
-
354
-
355
- </div>
356
- </div>
357
- <div class="tags">
358
- <h3>Parameters:</h3>
359
- <ul class="param">
360
-
361
- <li>
362
-
363
- <span class='name'>record</span>
364
-
365
-
366
- <span class='type'>(<tt>Object</tt>)</span>
367
-
368
-
369
-
370
- &mdash;
371
- <div class='inline'>
372
- <p>The user record</p>
373
- </div>
374
-
375
- </li>
376
-
377
- </ul>
378
-
379
-
380
- </div><table class="source_code">
381
- <tr>
382
- <td>
383
- <pre class="lines">
384
-
385
-
386
- 42
387
- 43
388
- 44
389
- 45
390
- 46
391
- 47
392
- 48
393
- 49
394
- 50
395
- 51
396
- 52
397
- 53
398
- 54
399
- 55
400
- 56
401
- 57
402
- 58
403
- 59
404
- 60
405
- 61
406
- 62
407
- 63
408
- 64
409
- 65</pre>
410
- </td>
411
- <td>
412
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/helpers/session.rb', line 42</span>
413
-
414
- <span class='kw'>def</span> <span class='id identifier rubyid_sign_in_as'>sign_in_as</span><span class='lparen'>(</span><span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
415
- <span class='gvar'>$signed_in</span> <span class='op'>=</span> <span class='kw'>true</span>
416
- <span class='ivar'>@current_user</span> <span class='op'>=</span> <span class='id identifier rubyid_user'>user</span>
417
-
418
- <span class='comment'># Your authentication filter should look something like:
419
- </span> <span class='comment'>#
420
- </span> <span class='comment'># class ApplicationController &lt; ActionController::Base
421
- </span> <span class='comment'># before_filter :authenticate
422
- </span> <span class='comment'>#
423
- </span> <span class='comment'># private
424
- </span> <span class='comment'>#
425
- </span> <span class='comment'># def authenticate!
426
- </span> <span class='comment'># redirect_to :new_sessions_url unless authenticated?
427
- </span> <span class='comment'># end
428
- </span> <span class='comment'>#
429
- </span> <span class='comment'># def authenticated?
430
- </span> <span class='comment'># $signed_in or begin
431
- </span> <span class='comment'># # Do your normal authentication logic here.
432
- </span> <span class='comment'># # E.g:
433
- </span> <span class='comment'># @current_user = User.find(session[:user_id]) if session[:user_id].present?
434
- </span> <span class='comment'># end
435
- </span> <span class='comment'># end
436
- </span> <span class='comment'># end
437
- </span><span class='kw'>end</span></pre>
438
- </td>
439
- </tr>
440
- </table>
441
- </div>
442
-
443
- <div class="method_details ">
444
- <p class="signature " id="sign_out-instance_method">
445
-
446
- - (<tt>Object</tt>) <strong>sign_out</strong>
447
-
448
-
449
-
450
- </p><div class="docstring">
451
- <div class="discussion">
452
-
453
- <p>See sign_in for details.</p>
454
-
455
- <p>Example: sign_out</p>
456
-
457
-
458
- </div>
459
- </div>
460
- <div class="tags">
461
-
462
-
463
- </div><table class="source_code">
464
- <tr>
465
- <td>
466
- <pre class="lines">
467
-
468
-
469
- 75
470
- 76
471
- 77
472
- 78</pre>
473
- </td>
474
- <td>
475
- <pre class="code"><span class="info file"># File 'lib/elabs_matchers/helpers/session.rb', line 75</span>
476
-
477
- <span class='kw'>def</span> <span class='id identifier rubyid_sign_out'>sign_out</span>
478
- <span class='gvar'>$signed_in</span> <span class='op'>=</span> <span class='kw'>false</span>
479
- <span class='ivar'>@current_user</span> <span class='op'>=</span> <span class='kw'>nil</span>
480
- <span class='kw'>end</span></pre>
481
- </td>
482
- </tr>
483
- </table>
484
- </div>
485
-
486
- </div>
487
-
488
- </div>
489
-
490
- <div id="footer">
491
- Generated on Fri Feb 17 16:29:16 2012 by
492
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
493
- 0.7.5 (ruby-1.9.3).
494
- </div>
495
-
496
- </body>
497
- </html>