rspec-rails 2.14.2 → 3.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data/.document +1 -1
- data/.yardopts +4 -2
- data/Capybara.md +2 -4
- data/Changelog.md +592 -34
- data/{License.txt → LICENSE.md} +5 -2
- data/README.md +290 -369
- data/lib/generators/rspec/controller/controller_generator.rb +1 -0
- data/lib/generators/rspec/controller/templates/controller_spec.rb +5 -5
- data/lib/generators/rspec/controller/templates/view_spec.rb +2 -2
- data/lib/generators/rspec/feature/feature_generator.rb +29 -0
- data/lib/generators/rspec/feature/templates/feature_singular_spec.rb +5 -0
- data/lib/generators/rspec/feature/templates/feature_spec.rb +5 -0
- data/lib/generators/rspec/generators/generator_generator.rb +24 -0
- data/lib/generators/rspec/generators/templates/generator_spec.rb +6 -0
- data/lib/generators/rspec/helper/helper_generator.rb +1 -0
- data/lib/generators/rspec/helper/templates/helper_spec.rb +2 -2
- data/lib/generators/rspec/install/install_generator.rb +44 -5
- data/lib/generators/rspec/install/templates/spec/rails_helper.rb +78 -0
- data/lib/generators/rspec/integration/integration_generator.rb +8 -13
- data/lib/generators/rspec/integration/templates/request_spec.rb +4 -9
- data/lib/generators/rspec/job/job_generator.rb +12 -0
- data/lib/generators/rspec/job/templates/job_spec.rb.erb +7 -0
- data/lib/generators/rspec/mailer/mailer_generator.rb +7 -0
- data/lib/generators/rspec/mailer/templates/mailer_spec.rb +7 -7
- data/lib/generators/rspec/mailer/templates/preview.rb +13 -0
- data/lib/generators/rspec/model/model_generator.rb +19 -5
- data/lib/generators/rspec/model/templates/fixtures.yml +1 -1
- data/lib/generators/rspec/model/templates/model_spec.rb +2 -2
- data/lib/generators/rspec/observer/observer_generator.rb +1 -0
- data/lib/generators/rspec/observer/templates/observer_spec.rb +2 -2
- data/lib/generators/rspec/request/request_generator.rb +10 -0
- data/lib/generators/rspec/scaffold/scaffold_generator.rb +68 -138
- data/lib/generators/rspec/scaffold/templates/api_controller_spec.rb +165 -0
- data/lib/generators/rspec/scaffold/templates/controller_spec.rb +98 -73
- data/lib/generators/rspec/scaffold/templates/edit_spec.rb +9 -13
- data/lib/generators/rspec/scaffold/templates/index_spec.rb +3 -10
- data/lib/generators/rspec/scaffold/templates/new_spec.rb +10 -14
- data/lib/generators/rspec/scaffold/templates/routing_spec.rb +21 -12
- data/lib/generators/rspec/scaffold/templates/show_spec.rb +4 -11
- data/lib/generators/rspec/system/system_generator.rb +26 -0
- data/lib/generators/rspec/system/templates/system_spec.rb +9 -0
- data/lib/generators/rspec/view/templates/view_spec.rb +2 -2
- data/lib/generators/rspec/view/view_generator.rb +1 -0
- data/lib/generators/rspec.rb +20 -6
- data/lib/rspec/rails/active_record.rb +25 -0
- data/lib/rspec/rails/adapters.rb +104 -37
- data/lib/rspec/rails/configuration.rb +148 -0
- data/lib/rspec/rails/example/controller_example_group.rb +188 -138
- data/lib/rspec/rails/example/feature_example_group.rb +63 -20
- data/lib/rspec/rails/example/helper_example_group.rb +35 -26
- data/lib/rspec/rails/example/job_example_group.rb +23 -0
- data/lib/rspec/rails/example/mailer_example_group.rb +30 -14
- data/lib/rspec/rails/example/model_example_group.rb +8 -7
- data/lib/rspec/rails/example/rails_example_group.rb +3 -1
- data/lib/rspec/rails/example/request_example_group.rb +23 -16
- data/lib/rspec/rails/example/routing_example_group.rb +49 -40
- data/lib/rspec/rails/example/system_example_group.rb +108 -0
- data/lib/rspec/rails/example/view_example_group.rb +168 -135
- data/lib/rspec/rails/example.rb +2 -33
- data/lib/rspec/rails/extensions/active_record/proxy.rb +0 -1
- data/lib/rspec/rails/extensions.rb +0 -1
- data/lib/rspec/rails/feature_check.rb +64 -0
- data/lib/rspec/rails/file_fixture_support.rb +17 -0
- data/lib/rspec/rails/fixture_file_upload_support.rb +40 -0
- data/lib/rspec/rails/fixture_support.rb +32 -13
- data/lib/rspec/rails/matchers/active_job.rb +317 -0
- data/lib/rspec/rails/matchers/base_matcher.rb +184 -0
- data/lib/rspec/rails/matchers/be_a_new.rb +69 -62
- data/lib/rspec/rails/matchers/be_new_record.rb +24 -21
- data/lib/rspec/rails/matchers/be_valid.rb +42 -33
- data/lib/rspec/rails/matchers/have_enqueued_mail.rb +174 -0
- data/lib/rspec/rails/matchers/have_http_status.rb +381 -0
- data/lib/rspec/rails/matchers/have_rendered.rb +54 -31
- data/lib/rspec/rails/matchers/redirect_to.rb +30 -29
- data/lib/rspec/rails/matchers/relation_match_array.rb +1 -1
- data/lib/rspec/rails/matchers/routing_matchers.rb +107 -93
- data/lib/rspec/rails/matchers.rb +13 -14
- data/lib/rspec/rails/tasks/rspec.rake +1 -1
- data/lib/rspec/rails/vendor/capybara.rb +10 -4
- data/lib/rspec/rails/version.rb +3 -1
- data/lib/rspec/rails/view_assigns.rb +18 -18
- data/lib/rspec/rails/view_path_builder.rb +29 -0
- data/lib/rspec/rails/view_rendering.rb +89 -63
- data/lib/rspec/rails/view_spec_methods.rb +56 -0
- data/lib/rspec/rails.rb +10 -10
- data/lib/rspec-rails.rb +66 -1
- data.tar.gz.sig +0 -0
- metadata +92 -77
- metadata.gz.sig +0 -0
- data/lib/autotest/rails_rspec2.rb +0 -85
- data/lib/generators/rspec/install/templates/.rspec +0 -1
- data/lib/generators/rspec/install/templates/spec/spec_helper.rb.tt +0 -49
- data/lib/rspec/rails/extensions/active_record/base.rb +0 -58
- data/lib/rspec/rails/matchers/have_extension.rb +0 -36
- data/lib/rspec/rails/mocks.rb +0 -274
- data/lib/rspec/rails/module_inclusion.rb +0 -19
- data/lib/rspec/rails/vendor/webrat.rb +0 -33
metadata
CHANGED
@@ -1,14 +1,50 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chelimsky
|
8
|
+
- Andy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J1aoV90BhxsvWTRizIbugbaqR6Tq3bj
|
42
|
+
Akt00cIlNSplL6DenIAKSh5kF7s0tRD0tC3bNkZmNjNGkdoGEcUODEpTB3RHKKiu
|
43
|
+
e6k2Jg6m00z5vGFQhOnROG/QaUzMA3A3mFBe1RHFo07xd0pFeoeWL3vF69Gx9Jwp
|
44
|
+
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
45
|
+
F3MdtaDehhjC
|
46
|
+
-----END CERTIFICATE-----
|
47
|
+
date: 2020-03-10 00:00:00.000000000 Z
|
12
48
|
dependencies:
|
13
49
|
- !ruby/object:Gem::Dependency
|
14
50
|
name: activesupport
|
@@ -24,20 +60,6 @@ dependencies:
|
|
24
60
|
- - ">="
|
25
61
|
- !ruby/object:Gem::Version
|
26
62
|
version: '3.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: activemodel
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '3.0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '3.0'
|
41
63
|
- !ruby/object:Gem::Dependency
|
42
64
|
name: actionpack
|
43
65
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,56 +94,56 @@ dependencies:
|
|
72
94
|
requirements:
|
73
95
|
- - "~>"
|
74
96
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
97
|
+
version: 3.9.0
|
76
98
|
type: :runtime
|
77
99
|
prerelease: false
|
78
100
|
version_requirements: !ruby/object:Gem::Requirement
|
79
101
|
requirements:
|
80
102
|
- - "~>"
|
81
103
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
104
|
+
version: 3.9.0
|
83
105
|
- !ruby/object:Gem::Dependency
|
84
106
|
name: rspec-expectations
|
85
107
|
requirement: !ruby/object:Gem::Requirement
|
86
108
|
requirements:
|
87
109
|
- - "~>"
|
88
110
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
111
|
+
version: 3.9.0
|
90
112
|
type: :runtime
|
91
113
|
prerelease: false
|
92
114
|
version_requirements: !ruby/object:Gem::Requirement
|
93
115
|
requirements:
|
94
116
|
- - "~>"
|
95
117
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
118
|
+
version: 3.9.0
|
97
119
|
- !ruby/object:Gem::Dependency
|
98
120
|
name: rspec-mocks
|
99
121
|
requirement: !ruby/object:Gem::Requirement
|
100
122
|
requirements:
|
101
123
|
- - "~>"
|
102
124
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
125
|
+
version: 3.9.0
|
104
126
|
type: :runtime
|
105
127
|
prerelease: false
|
106
128
|
version_requirements: !ruby/object:Gem::Requirement
|
107
129
|
requirements:
|
108
130
|
- - "~>"
|
109
131
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
132
|
+
version: 3.9.0
|
111
133
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
134
|
+
name: rspec-support
|
113
135
|
requirement: !ruby/object:Gem::Requirement
|
114
136
|
requirements:
|
115
137
|
- - "~>"
|
116
138
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
118
|
-
type: :
|
139
|
+
version: 3.9.0
|
140
|
+
type: :runtime
|
119
141
|
prerelease: false
|
120
142
|
version_requirements: !ruby/object:Gem::Requirement
|
121
143
|
requirements:
|
122
144
|
- - "~>"
|
123
145
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
146
|
+
version: 3.9.0
|
125
147
|
- !ruby/object:Gem::Dependency
|
126
148
|
name: cucumber
|
127
149
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,58 +164,30 @@ dependencies:
|
|
142
164
|
requirements:
|
143
165
|
- - "~>"
|
144
166
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
167
|
+
version: 0.14.12
|
146
168
|
type: :development
|
147
169
|
prerelease: false
|
148
170
|
version_requirements: !ruby/object:Gem::Requirement
|
149
171
|
requirements:
|
150
172
|
- - "~>"
|
151
173
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
174
|
+
version: 0.14.12
|
153
175
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
176
|
+
name: ammeter
|
155
177
|
requirement: !ruby/object:Gem::Requirement
|
156
178
|
requirements:
|
157
179
|
- - "~>"
|
158
180
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
181
|
+
version: 1.1.2
|
160
182
|
type: :development
|
161
183
|
prerelease: false
|
162
184
|
version_requirements: !ruby/object:Gem::Requirement
|
163
185
|
requirements:
|
164
186
|
- - "~>"
|
165
187
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
167
|
-
-
|
168
|
-
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - '='
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: 0.2.5
|
174
|
-
type: :development
|
175
|
-
prerelease: false
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
177
|
-
requirements:
|
178
|
-
- - '='
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
version: 0.2.5
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: capybara
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - ">="
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: 2.0.0
|
188
|
-
type: :development
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - ">="
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: 2.0.0
|
195
|
-
description: RSpec for Rails
|
196
|
-
email: rspec-users@rubyforge.org
|
188
|
+
version: 1.1.2
|
189
|
+
description: rspec-rails is a testing framework for Rails 3+.
|
190
|
+
email: rspec@googlegroups.com
|
197
191
|
executables: []
|
198
192
|
extensions: []
|
199
193
|
extra_rdoc_files: []
|
@@ -202,75 +196,98 @@ files:
|
|
202
196
|
- ".yardopts"
|
203
197
|
- Capybara.md
|
204
198
|
- Changelog.md
|
205
|
-
-
|
199
|
+
- LICENSE.md
|
206
200
|
- README.md
|
207
|
-
- lib/autotest/rails_rspec2.rb
|
208
201
|
- lib/generators/rspec.rb
|
209
202
|
- lib/generators/rspec/controller/controller_generator.rb
|
210
203
|
- lib/generators/rspec/controller/templates/controller_spec.rb
|
211
204
|
- lib/generators/rspec/controller/templates/view_spec.rb
|
205
|
+
- lib/generators/rspec/feature/feature_generator.rb
|
206
|
+
- lib/generators/rspec/feature/templates/feature_singular_spec.rb
|
207
|
+
- lib/generators/rspec/feature/templates/feature_spec.rb
|
208
|
+
- lib/generators/rspec/generators/generator_generator.rb
|
209
|
+
- lib/generators/rspec/generators/templates/generator_spec.rb
|
212
210
|
- lib/generators/rspec/helper/helper_generator.rb
|
213
211
|
- lib/generators/rspec/helper/templates/helper_spec.rb
|
214
212
|
- lib/generators/rspec/install/install_generator.rb
|
215
|
-
- lib/generators/rspec/install/templates
|
216
|
-
- lib/generators/rspec/install/templates/spec/spec_helper.rb.tt
|
213
|
+
- lib/generators/rspec/install/templates/spec/rails_helper.rb
|
217
214
|
- lib/generators/rspec/integration/integration_generator.rb
|
218
215
|
- lib/generators/rspec/integration/templates/request_spec.rb
|
216
|
+
- lib/generators/rspec/job/job_generator.rb
|
217
|
+
- lib/generators/rspec/job/templates/job_spec.rb.erb
|
219
218
|
- lib/generators/rspec/mailer/mailer_generator.rb
|
220
219
|
- lib/generators/rspec/mailer/templates/fixture
|
221
220
|
- lib/generators/rspec/mailer/templates/mailer_spec.rb
|
221
|
+
- lib/generators/rspec/mailer/templates/preview.rb
|
222
222
|
- lib/generators/rspec/model/model_generator.rb
|
223
223
|
- lib/generators/rspec/model/templates/fixtures.yml
|
224
224
|
- lib/generators/rspec/model/templates/model_spec.rb
|
225
225
|
- lib/generators/rspec/observer/observer_generator.rb
|
226
226
|
- lib/generators/rspec/observer/templates/observer_spec.rb
|
227
|
+
- lib/generators/rspec/request/request_generator.rb
|
227
228
|
- lib/generators/rspec/scaffold/scaffold_generator.rb
|
229
|
+
- lib/generators/rspec/scaffold/templates/api_controller_spec.rb
|
228
230
|
- lib/generators/rspec/scaffold/templates/controller_spec.rb
|
229
231
|
- lib/generators/rspec/scaffold/templates/edit_spec.rb
|
230
232
|
- lib/generators/rspec/scaffold/templates/index_spec.rb
|
231
233
|
- lib/generators/rspec/scaffold/templates/new_spec.rb
|
232
234
|
- lib/generators/rspec/scaffold/templates/routing_spec.rb
|
233
235
|
- lib/generators/rspec/scaffold/templates/show_spec.rb
|
236
|
+
- lib/generators/rspec/system/system_generator.rb
|
237
|
+
- lib/generators/rspec/system/templates/system_spec.rb
|
234
238
|
- lib/generators/rspec/view/templates/view_spec.rb
|
235
239
|
- lib/generators/rspec/view/view_generator.rb
|
236
240
|
- lib/rspec-rails.rb
|
237
241
|
- lib/rspec/rails.rb
|
242
|
+
- lib/rspec/rails/active_record.rb
|
238
243
|
- lib/rspec/rails/adapters.rb
|
244
|
+
- lib/rspec/rails/configuration.rb
|
239
245
|
- lib/rspec/rails/example.rb
|
240
246
|
- lib/rspec/rails/example/controller_example_group.rb
|
241
247
|
- lib/rspec/rails/example/feature_example_group.rb
|
242
248
|
- lib/rspec/rails/example/helper_example_group.rb
|
249
|
+
- lib/rspec/rails/example/job_example_group.rb
|
243
250
|
- lib/rspec/rails/example/mailer_example_group.rb
|
244
251
|
- lib/rspec/rails/example/model_example_group.rb
|
245
252
|
- lib/rspec/rails/example/rails_example_group.rb
|
246
253
|
- lib/rspec/rails/example/request_example_group.rb
|
247
254
|
- lib/rspec/rails/example/routing_example_group.rb
|
255
|
+
- lib/rspec/rails/example/system_example_group.rb
|
248
256
|
- lib/rspec/rails/example/view_example_group.rb
|
249
257
|
- lib/rspec/rails/extensions.rb
|
250
|
-
- lib/rspec/rails/extensions/active_record/base.rb
|
251
258
|
- lib/rspec/rails/extensions/active_record/proxy.rb
|
259
|
+
- lib/rspec/rails/feature_check.rb
|
260
|
+
- lib/rspec/rails/file_fixture_support.rb
|
261
|
+
- lib/rspec/rails/fixture_file_upload_support.rb
|
252
262
|
- lib/rspec/rails/fixture_support.rb
|
253
263
|
- lib/rspec/rails/matchers.rb
|
264
|
+
- lib/rspec/rails/matchers/active_job.rb
|
265
|
+
- lib/rspec/rails/matchers/base_matcher.rb
|
254
266
|
- lib/rspec/rails/matchers/be_a_new.rb
|
255
267
|
- lib/rspec/rails/matchers/be_new_record.rb
|
256
268
|
- lib/rspec/rails/matchers/be_valid.rb
|
257
|
-
- lib/rspec/rails/matchers/
|
269
|
+
- lib/rspec/rails/matchers/have_enqueued_mail.rb
|
270
|
+
- lib/rspec/rails/matchers/have_http_status.rb
|
258
271
|
- lib/rspec/rails/matchers/have_rendered.rb
|
259
272
|
- lib/rspec/rails/matchers/redirect_to.rb
|
260
273
|
- lib/rspec/rails/matchers/relation_match_array.rb
|
261
274
|
- lib/rspec/rails/matchers/routing_matchers.rb
|
262
|
-
- lib/rspec/rails/mocks.rb
|
263
|
-
- lib/rspec/rails/module_inclusion.rb
|
264
275
|
- lib/rspec/rails/tasks/rspec.rake
|
265
276
|
- lib/rspec/rails/vendor/capybara.rb
|
266
|
-
- lib/rspec/rails/vendor/webrat.rb
|
267
277
|
- lib/rspec/rails/version.rb
|
268
278
|
- lib/rspec/rails/view_assigns.rb
|
279
|
+
- lib/rspec/rails/view_path_builder.rb
|
269
280
|
- lib/rspec/rails/view_rendering.rb
|
270
|
-
|
281
|
+
- lib/rspec/rails/view_spec_methods.rb
|
282
|
+
homepage: https://github.com/rspec/rspec-rails
|
271
283
|
licenses:
|
272
284
|
- MIT
|
273
|
-
metadata:
|
285
|
+
metadata:
|
286
|
+
bug_tracker_uri: https://github.com/rspec/rspec-rails/issues
|
287
|
+
changelog_uri: https://github.com/rspec/rspec-rails/blob/v3.9.1/Changelog.md
|
288
|
+
documentation_uri: https://rspec.info/documentation/
|
289
|
+
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
290
|
+
source_code_uri: https://github.com/rspec/rspec-rails
|
274
291
|
post_install_message:
|
275
292
|
rdoc_options:
|
276
293
|
- "--charset=UTF-8"
|
@@ -287,10 +304,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
287
304
|
- !ruby/object:Gem::Version
|
288
305
|
version: '0'
|
289
306
|
requirements: []
|
290
|
-
|
291
|
-
rubygems_version: 2.2.0
|
307
|
+
rubygems_version: 3.1.2
|
292
308
|
signing_key:
|
293
309
|
specification_version: 4
|
294
|
-
summary:
|
310
|
+
summary: RSpec for Rails
|
295
311
|
test_files: []
|
296
|
-
has_rdoc:
|
metadata.gz.sig
ADDED
Binary file
|
@@ -1,85 +0,0 @@
|
|
1
|
-
# (c) Copyright 2006 Nick Sieger <nicksieger@gmail.com>
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person
|
4
|
-
# obtaining a copy of this software and associated documentation files
|
5
|
-
# (the "Software"), to deal in the Software without restriction,
|
6
|
-
# including without limitation the rights to use, copy, modify, merge,
|
7
|
-
# publish, distribute, sublicense, and/or sell copies of the Software,
|
8
|
-
# and to permit persons to whom the Software is furnished to do so,
|
9
|
-
# subject to the following conditions:
|
10
|
-
#
|
11
|
-
# The above copyright notice and this permission notice shall be
|
12
|
-
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
14
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
18
|
-
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
19
|
-
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
-
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
# SOFTWARE.
|
22
|
-
|
23
|
-
$:.push(*Dir["vendor/rails/*/lib"])
|
24
|
-
|
25
|
-
require 'active_support'
|
26
|
-
require 'active_support/core_ext'
|
27
|
-
require 'autotest/rspec2'
|
28
|
-
|
29
|
-
class Autotest::RailsRspec2 < Autotest::Rspec2
|
30
|
-
|
31
|
-
def initialize
|
32
|
-
super
|
33
|
-
setup_rails_rspec2_mappings
|
34
|
-
end
|
35
|
-
|
36
|
-
def setup_rails_rspec2_mappings
|
37
|
-
%w{coverage/ db/ doc/ log/ public/ script/ tmp/ vendor/rails vendor/plugins vendor/gems}.each do |exception|
|
38
|
-
add_exception(/^([\.\/]*)?#{exception}/)
|
39
|
-
end
|
40
|
-
|
41
|
-
clear_mappings
|
42
|
-
|
43
|
-
add_mapping(%r%^(test|spec)/fixtures/(.*).yml$%) { |_, m|
|
44
|
-
["spec/models/#{m[2].singularize}_spec.rb"] + files_matching(%r%^spec\/views\/#{m[2]}/.*_spec\.rb$%)
|
45
|
-
}
|
46
|
-
add_mapping(%r%^spec/.*_spec\.rb$%) { |filename, _|
|
47
|
-
filename
|
48
|
-
}
|
49
|
-
add_mapping(%r%^app/models/(.*)\.rb$%) { |_, m|
|
50
|
-
["spec/models/#{m[1]}_spec.rb"]
|
51
|
-
}
|
52
|
-
add_mapping(%r%^app/views/(.*)$%) { |_, m|
|
53
|
-
files_matching %r%^spec/views/#{m[1]}_spec.rb$%
|
54
|
-
}
|
55
|
-
add_mapping(%r%^app/controllers/(.*)\.rb$%) { |_, m|
|
56
|
-
if m[1] == "application"
|
57
|
-
files_matching %r%^spec/controllers/.*_spec\.rb$%
|
58
|
-
else
|
59
|
-
["spec/controllers/#{m[1]}_spec.rb"]
|
60
|
-
end
|
61
|
-
}
|
62
|
-
add_mapping(%r%^app/helpers/(.*)_helper\.rb$%) { |_, m|
|
63
|
-
if m[1] == "application" then
|
64
|
-
files_matching(%r%^spec/(views|helpers)/.*_spec\.rb$%)
|
65
|
-
else
|
66
|
-
["spec/helpers/#{m[1]}_helper_spec.rb"] + files_matching(%r%^spec\/views\/#{m[1]}/.*_spec\.rb$%)
|
67
|
-
end
|
68
|
-
}
|
69
|
-
add_mapping(%r%^config/routes\.rb$%) {
|
70
|
-
files_matching %r%^spec/(controllers|routing|views|helpers)/.*_spec\.rb$%
|
71
|
-
}
|
72
|
-
add_mapping(%r%^config/database\.yml$%) { |_, m|
|
73
|
-
files_matching %r%^spec/models/.*_spec\.rb$%
|
74
|
-
}
|
75
|
-
add_mapping(%r%^(spec/(spec_helper|support/.*)|config/(boot|environment(s/test)?))\.rb$%) {
|
76
|
-
files_matching %r%^spec/(models|controllers|routing|views|helpers)/.*_spec\.rb$%
|
77
|
-
}
|
78
|
-
add_mapping(%r%^lib/(.*)\.rb$%) { |_, m|
|
79
|
-
["spec/lib/#{m[1]}_spec.rb"]
|
80
|
-
}
|
81
|
-
add_mapping(%r%^app/mailers/(.*)\.rb$%) { |_, m|
|
82
|
-
["spec/mailers/#{m[1]}_spec.rb"]
|
83
|
-
}
|
84
|
-
end
|
85
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
--color
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
-
ENV["RAILS_ENV"] ||= 'test'
|
3
|
-
require File.expand_path("../../config/environment", __FILE__)
|
4
|
-
require 'rspec/rails'
|
5
|
-
require 'rspec/autorun'
|
6
|
-
|
7
|
-
# Requires supporting ruby files with custom matchers and macros, etc,
|
8
|
-
# in spec/support/ and its subdirectories.
|
9
|
-
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
10
|
-
|
11
|
-
<% if ::Rails::VERSION::STRING >= '4.1' -%>
|
12
|
-
# Checks for pending migrations before tests are run.
|
13
|
-
# If you are not using ActiveRecord, you can remove this line.
|
14
|
-
ActiveRecord::Migration.maintain_test_schema!
|
15
|
-
|
16
|
-
<% elsif ::Rails::VERSION::STRING >= '4' -%>
|
17
|
-
# Checks for pending migrations before tests are run.
|
18
|
-
# If you are not using ActiveRecord, you can remove this line.
|
19
|
-
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
|
20
|
-
|
21
|
-
<% end -%>
|
22
|
-
RSpec.configure do |config|
|
23
|
-
# ## Mock Framework
|
24
|
-
#
|
25
|
-
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
26
|
-
#
|
27
|
-
# config.mock_with :mocha
|
28
|
-
# config.mock_with :flexmock
|
29
|
-
# config.mock_with :rr
|
30
|
-
|
31
|
-
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
32
|
-
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
33
|
-
|
34
|
-
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
35
|
-
# examples within a transaction, remove the following line or assign false
|
36
|
-
# instead of true.
|
37
|
-
config.use_transactional_fixtures = true
|
38
|
-
|
39
|
-
# If true, the base class of anonymous controllers will be inferred
|
40
|
-
# automatically. This will be the default behavior in future versions of
|
41
|
-
# rspec-rails.
|
42
|
-
config.infer_base_class_for_anonymous_controllers = false
|
43
|
-
|
44
|
-
# Run specs in random order to surface order dependencies. If you find an
|
45
|
-
# order dependency and want to debug it, you can fix the order by providing
|
46
|
-
# the seed, which is printed after each run.
|
47
|
-
# --seed 1234
|
48
|
-
config.order = "random"
|
49
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
module RSpec
|
2
|
-
module Rails
|
3
|
-
if defined?(ActiveRecord)
|
4
|
-
module Extensions
|
5
|
-
module ActiveRecord
|
6
|
-
# Extension to enhance `to have` on AR Model classes
|
7
|
-
#
|
8
|
-
# @example
|
9
|
-
#
|
10
|
-
# ModelClass.should have(:no).records
|
11
|
-
# ModelClass.should have(1).record
|
12
|
-
# ModelClass.should have(n).records
|
13
|
-
if ::ActiveRecord::VERSION::STRING >= '4'
|
14
|
-
def records
|
15
|
-
all.to_a
|
16
|
-
end
|
17
|
-
else
|
18
|
-
def records
|
19
|
-
find(:all)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
alias :record :records
|
23
|
-
end
|
24
|
-
|
25
|
-
class ::ActiveRecord::Base
|
26
|
-
extend RSpec::Rails::Extensions::ActiveRecord
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
if defined?(::ActiveModel)
|
34
|
-
module ::ActiveModel::Validations
|
35
|
-
# Extension to enhance `to have` on AR Model instances. Calls
|
36
|
-
# model.valid? in order to prepare the object's errors object. Accepts
|
37
|
-
# a :context option to specify the validation context.
|
38
|
-
#
|
39
|
-
# You can also use this to specify the content of the error messages.
|
40
|
-
#
|
41
|
-
# @example
|
42
|
-
#
|
43
|
-
# expect(model).to have(:no).errors_on(:attribute)
|
44
|
-
# expect(model).to have(1).error_on(:attribute)
|
45
|
-
# expect(model).to have(n).errors_on(:attribute)
|
46
|
-
# expect(model).to have(n).errors_on(:attribute, :context => :create)
|
47
|
-
#
|
48
|
-
# expect(model.errors_on(:attribute)).to include("can't be blank")
|
49
|
-
def errors_on(attribute, options = {})
|
50
|
-
valid_args = [options[:context]].compact
|
51
|
-
self.valid?(*valid_args)
|
52
|
-
|
53
|
-
[self.errors[attribute]].flatten.compact
|
54
|
-
end
|
55
|
-
|
56
|
-
alias :error_on :errors_on
|
57
|
-
end
|
58
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'active_support'
|
2
|
-
require 'active_support/core_ext/module/aliasing'
|
3
|
-
require 'rspec/matchers/built_in/have'
|
4
|
-
|
5
|
-
module RSpec::Rails::Matchers
|
6
|
-
module HaveExtensions
|
7
|
-
extend ActiveSupport::Concern
|
8
|
-
|
9
|
-
# @api private
|
10
|
-
#
|
11
|
-
# Enhances the failure message for `should have(n)` matchers
|
12
|
-
def failure_message_for_should_with_errors_on_extensions
|
13
|
-
return "expected #{relativities[@relativity]}#{@expected} errors on :#{@args[0]}, got #{@actual}" if @collection_name == :errors_on
|
14
|
-
return "expected #{relativities[@relativity]}#{@expected} error on :#{@args[0]}, got #{@actual}" if @collection_name == :error_on
|
15
|
-
return failure_message_for_should_without_errors_on_extensions
|
16
|
-
end
|
17
|
-
|
18
|
-
# @api private
|
19
|
-
#
|
20
|
-
# Enhances the description for `should have(n)` matchers
|
21
|
-
def description_with_errors_on_extensions
|
22
|
-
return "have #{relativities[@relativity]}#{@expected} errors on :#{@args[0]}" if @collection_name == :errors_on
|
23
|
-
return "have #{relativities[@relativity]}#{@expected} error on :#{@args[0]}" if @collection_name == :error_on
|
24
|
-
return description_without_errors_on_extensions
|
25
|
-
end
|
26
|
-
|
27
|
-
included do
|
28
|
-
alias_method_chain :failure_message_for_should, :errors_on_extensions
|
29
|
-
alias_method_chain :description, :errors_on_extensions
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
RSpec::Matchers::BuiltIn::Have.class_eval do
|
35
|
-
include RSpec::Rails::Matchers::HaveExtensions
|
36
|
-
end
|