rspec-rails 4.0.0.beta3 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Capybara.md +5 -54
- data/Changelog.md +61 -7
- data/README.md +20 -19
- data/lib/generators/rspec.rb +0 -6
- data/lib/generators/rspec/controller/controller_generator.rb +13 -5
- data/lib/generators/rspec/controller/templates/request_spec.rb +14 -0
- data/lib/generators/rspec/controller/templates/routing_spec.rb +1 -1
- data/lib/generators/rspec/feature/feature_generator.rb +2 -2
- data/lib/generators/rspec/{generators → generator}/generator_generator.rb +2 -2
- data/lib/generators/rspec/{generators → generator}/templates/generator_spec.rb +0 -0
- data/lib/generators/rspec/helper/helper_generator.rb +1 -1
- data/lib/generators/rspec/install/install_generator.rb +4 -4
- data/lib/generators/rspec/install/templates/spec/rails_helper.rb +17 -16
- data/lib/generators/rspec/integration/integration_generator.rb +3 -3
- data/lib/generators/rspec/mailer/mailer_generator.rb +1 -1
- data/lib/generators/rspec/model/model_generator.rb +4 -4
- data/lib/generators/rspec/scaffold/scaffold_generator.rb +26 -18
- data/lib/generators/rspec/scaffold/templates/api_controller_spec.rb +0 -36
- data/lib/generators/rspec/scaffold/templates/api_request_spec.rb +131 -0
- data/lib/generators/rspec/scaffold/templates/controller_spec.rb +10 -10
- data/lib/generators/rspec/scaffold/templates/edit_spec.rb +1 -1
- data/lib/generators/rspec/scaffold/templates/index_spec.rb +2 -2
- data/lib/generators/rspec/scaffold/templates/new_spec.rb +1 -1
- data/lib/generators/rspec/scaffold/templates/request_spec.rb +133 -0
- data/lib/generators/rspec/scaffold/templates/routing_spec.rb +8 -10
- data/lib/generators/rspec/scaffold/templates/show_spec.rb +1 -1
- data/lib/generators/rspec/system/system_generator.rb +1 -1
- data/lib/generators/rspec/view/view_generator.rb +2 -2
- data/lib/rspec-rails.rb +6 -9
- data/lib/rspec/rails/adapters.rb +10 -76
- data/lib/rspec/rails/configuration.rb +72 -36
- data/lib/rspec/rails/example/channel_example_group.rb +2 -2
- data/lib/rspec/rails/example/controller_example_group.rb +4 -4
- data/lib/rspec/rails/example/feature_example_group.rb +6 -26
- data/lib/rspec/rails/example/helper_example_group.rb +2 -10
- data/lib/rspec/rails/example/mailbox_example_group.rb +1 -1
- data/lib/rspec/rails/example/mailer_example_group.rb +2 -2
- data/lib/rspec/rails/example/rails_example_group.rb +1 -1
- data/lib/rspec/rails/example/system_example_group.rb +14 -7
- data/lib/rspec/rails/example/view_example_group.rb +38 -48
- data/lib/rspec/rails/extensions/active_record/proxy.rb +5 -10
- data/lib/rspec/rails/feature_check.rb +1 -28
- data/lib/rspec/rails/fixture_file_upload_support.rb +8 -13
- data/lib/rspec/rails/fixture_support.rb +37 -31
- data/lib/rspec/rails/matchers/action_cable.rb +1 -1
- data/lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb +3 -3
- data/lib/rspec/rails/matchers/active_job.rb +132 -18
- data/lib/rspec/rails/matchers/base_matcher.rb +4 -10
- data/lib/rspec/rails/matchers/have_enqueued_mail.rb +9 -6
- data/lib/rspec/rails/matchers/have_http_status.rb +7 -7
- data/lib/rspec/rails/matchers/relation_match_array.rb +1 -1
- data/lib/rspec/rails/matchers/routing_matchers.rb +11 -11
- data/lib/rspec/rails/tasks/rspec.rake +7 -17
- data/lib/rspec/rails/vendor/capybara.rb +10 -15
- data/lib/rspec/rails/version.rb +1 -1
- data/lib/rspec/rails/view_path_builder.rb +1 -1
- data/lib/rspec/rails/view_rendering.rb +3 -3
- metadata +34 -33
- metadata.gz.sig +0 -0
- data/lib/generators/rspec/observer/observer_generator.rb +0 -13
- data/lib/generators/rspec/observer/templates/observer_spec.rb +0 -7
@@ -9,31 +9,26 @@ rescue LoadError
|
|
9
9
|
end
|
10
10
|
|
11
11
|
if defined?(Capybara)
|
12
|
-
require 'rspec/support/comparable_version'
|
13
|
-
unless RSpec::Support::ComparableVersion.new(Capybara::VERSION) >= '2.2.0'
|
14
|
-
raise "You are using capybara #{Capybara::VERSION}. RSpec requires >= 2.2.0."
|
15
|
-
end
|
16
|
-
|
17
12
|
RSpec.configure do |c|
|
18
13
|
if defined?(Capybara::DSL)
|
19
|
-
c.include Capybara::DSL, :
|
14
|
+
c.include Capybara::DSL, type: :feature
|
20
15
|
if defined?(ActionPack) && ActionPack::VERSION::STRING >= "5.1"
|
21
|
-
c.include Capybara::DSL, :
|
16
|
+
c.include Capybara::DSL, type: :system
|
22
17
|
end
|
23
18
|
end
|
24
19
|
|
25
20
|
if defined?(Capybara::RSpecMatchers)
|
26
|
-
c.include Capybara::RSpecMatchers, :
|
27
|
-
c.include Capybara::RSpecMatchers, :
|
28
|
-
c.include Capybara::RSpecMatchers, :
|
29
|
-
c.include Capybara::RSpecMatchers, :
|
30
|
-
c.include Capybara::RSpecMatchers, :
|
31
|
-
c.include Capybara::RSpecMatchers, :
|
21
|
+
c.include Capybara::RSpecMatchers, type: :view
|
22
|
+
c.include Capybara::RSpecMatchers, type: :helper
|
23
|
+
c.include Capybara::RSpecMatchers, type: :mailer
|
24
|
+
c.include Capybara::RSpecMatchers, type: :controller
|
25
|
+
c.include Capybara::RSpecMatchers, type: :feature
|
26
|
+
c.include Capybara::RSpecMatchers, type: :system
|
32
27
|
end
|
33
28
|
|
34
29
|
unless defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL)
|
35
|
-
c.include Capybara, :
|
36
|
-
c.include Capybara, :
|
30
|
+
c.include Capybara, type: :request
|
31
|
+
c.include Capybara, type: :controller
|
37
32
|
end
|
38
33
|
end
|
39
34
|
end
|
data/lib/rspec/rails/version.rb
CHANGED
@@ -20,7 +20,7 @@ module RSpec
|
|
20
20
|
# view_path_builder.path_for({ :controller => 'posts', :action => 'delete' })
|
21
21
|
# # => ActionController::UrlGenerationError: No route matches {:action=>"delete", :controller=>"posts"}
|
22
22
|
def path_for(path_params)
|
23
|
-
url_for(path_params.merge(:
|
23
|
+
url_for(path_params.merge(only_path: true))
|
24
24
|
rescue => e
|
25
25
|
e.message
|
26
26
|
end
|
@@ -55,9 +55,9 @@ module RSpec
|
|
55
55
|
"",
|
56
56
|
template.identifier,
|
57
57
|
EmptyTemplateHandler,
|
58
|
-
:
|
59
|
-
:
|
60
|
-
:
|
58
|
+
virtual_path: template.virtual_path,
|
59
|
+
format: template_format(template),
|
60
|
+
locals: []
|
61
61
|
)
|
62
62
|
end
|
63
63
|
end
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chelimsky
|
8
8
|
- Andy Lindeman
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain:
|
12
12
|
- |
|
@@ -44,10 +44,10 @@ cert_chain:
|
|
44
44
|
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
45
45
|
F3MdtaDehhjC
|
46
46
|
-----END CERTIFICATE-----
|
47
|
-
date:
|
47
|
+
date: 2020-12-26 00:00:00.000000000 Z
|
48
48
|
dependencies:
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
|
-
name:
|
50
|
+
name: actionpack
|
51
51
|
requirement: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - ">="
|
@@ -61,7 +61,7 @@ dependencies:
|
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '4.2'
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
|
-
name:
|
64
|
+
name: activesupport
|
65
65
|
requirement: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
@@ -94,99 +94,99 @@ dependencies:
|
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '3.
|
97
|
+
version: '3.10'
|
98
98
|
type: :runtime
|
99
99
|
prerelease: false
|
100
100
|
version_requirements: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - "~>"
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: '3.
|
104
|
+
version: '3.10'
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
name: rspec-expectations
|
107
107
|
requirement: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
109
|
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: '3.
|
111
|
+
version: '3.10'
|
112
112
|
type: :runtime
|
113
113
|
prerelease: false
|
114
114
|
version_requirements: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: '3.
|
118
|
+
version: '3.10'
|
119
119
|
- !ruby/object:Gem::Dependency
|
120
120
|
name: rspec-mocks
|
121
121
|
requirement: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: '3.
|
125
|
+
version: '3.10'
|
126
126
|
type: :runtime
|
127
127
|
prerelease: false
|
128
128
|
version_requirements: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
130
|
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: '3.
|
132
|
+
version: '3.10'
|
133
133
|
- !ruby/object:Gem::Dependency
|
134
134
|
name: rspec-support
|
135
135
|
requirement: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
137
|
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: '3.
|
139
|
+
version: '3.10'
|
140
140
|
type: :runtime
|
141
141
|
prerelease: false
|
142
142
|
version_requirements: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
144
|
- - "~>"
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version: '3.
|
146
|
+
version: '3.10'
|
147
147
|
- !ruby/object:Gem::Dependency
|
148
|
-
name:
|
148
|
+
name: ammeter
|
149
149
|
requirement: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
151
|
- - "~>"
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version: 1.
|
153
|
+
version: 1.1.2
|
154
154
|
type: :development
|
155
155
|
prerelease: false
|
156
156
|
version_requirements: !ruby/object:Gem::Requirement
|
157
157
|
requirements:
|
158
158
|
- - "~>"
|
159
159
|
- !ruby/object:Gem::Version
|
160
|
-
version: 1.
|
160
|
+
version: 1.1.2
|
161
161
|
- !ruby/object:Gem::Dependency
|
162
162
|
name: aruba
|
163
163
|
requirement: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
165
|
- - "~>"
|
166
166
|
- !ruby/object:Gem::Version
|
167
|
-
version: 0.
|
167
|
+
version: 0.14.12
|
168
168
|
type: :development
|
169
169
|
prerelease: false
|
170
170
|
version_requirements: !ruby/object:Gem::Requirement
|
171
171
|
requirements:
|
172
172
|
- - "~>"
|
173
173
|
- !ruby/object:Gem::Version
|
174
|
-
version: 0.
|
174
|
+
version: 0.14.12
|
175
175
|
- !ruby/object:Gem::Dependency
|
176
|
-
name:
|
176
|
+
name: cucumber
|
177
177
|
requirement: !ruby/object:Gem::Requirement
|
178
178
|
requirements:
|
179
179
|
- - "~>"
|
180
180
|
- !ruby/object:Gem::Version
|
181
|
-
version: 1.
|
181
|
+
version: 1.3.5
|
182
182
|
type: :development
|
183
183
|
prerelease: false
|
184
184
|
version_requirements: !ruby/object:Gem::Requirement
|
185
185
|
requirements:
|
186
186
|
- - "~>"
|
187
187
|
- !ruby/object:Gem::Version
|
188
|
-
version: 1.
|
189
|
-
description: rspec-rails is a testing framework for Rails
|
188
|
+
version: 1.3.5
|
189
|
+
description: rspec-rails is a testing framework for Rails 5+.
|
190
190
|
email: rspec@googlegroups.com
|
191
191
|
executables: []
|
192
192
|
extensions: []
|
@@ -203,13 +203,14 @@ files:
|
|
203
203
|
- lib/generators/rspec/channel/templates/channel_spec.rb.erb
|
204
204
|
- lib/generators/rspec/controller/controller_generator.rb
|
205
205
|
- lib/generators/rspec/controller/templates/controller_spec.rb
|
206
|
+
- lib/generators/rspec/controller/templates/request_spec.rb
|
206
207
|
- lib/generators/rspec/controller/templates/routing_spec.rb
|
207
208
|
- lib/generators/rspec/controller/templates/view_spec.rb
|
208
209
|
- lib/generators/rspec/feature/feature_generator.rb
|
209
210
|
- lib/generators/rspec/feature/templates/feature_singular_spec.rb
|
210
211
|
- lib/generators/rspec/feature/templates/feature_spec.rb
|
211
|
-
- lib/generators/rspec/
|
212
|
-
- lib/generators/rspec/
|
212
|
+
- lib/generators/rspec/generator/generator_generator.rb
|
213
|
+
- lib/generators/rspec/generator/templates/generator_spec.rb
|
213
214
|
- lib/generators/rspec/helper/helper_generator.rb
|
214
215
|
- lib/generators/rspec/helper/templates/helper_spec.rb
|
215
216
|
- lib/generators/rspec/install/install_generator.rb
|
@@ -227,15 +228,15 @@ files:
|
|
227
228
|
- lib/generators/rspec/model/model_generator.rb
|
228
229
|
- lib/generators/rspec/model/templates/fixtures.yml
|
229
230
|
- lib/generators/rspec/model/templates/model_spec.rb
|
230
|
-
- lib/generators/rspec/observer/observer_generator.rb
|
231
|
-
- lib/generators/rspec/observer/templates/observer_spec.rb
|
232
231
|
- lib/generators/rspec/request/request_generator.rb
|
233
232
|
- lib/generators/rspec/scaffold/scaffold_generator.rb
|
234
233
|
- lib/generators/rspec/scaffold/templates/api_controller_spec.rb
|
234
|
+
- lib/generators/rspec/scaffold/templates/api_request_spec.rb
|
235
235
|
- lib/generators/rspec/scaffold/templates/controller_spec.rb
|
236
236
|
- lib/generators/rspec/scaffold/templates/edit_spec.rb
|
237
237
|
- lib/generators/rspec/scaffold/templates/index_spec.rb
|
238
238
|
- lib/generators/rspec/scaffold/templates/new_spec.rb
|
239
|
+
- lib/generators/rspec/scaffold/templates/request_spec.rb
|
239
240
|
- lib/generators/rspec/scaffold/templates/routing_spec.rb
|
240
241
|
- lib/generators/rspec/scaffold/templates/show_spec.rb
|
241
242
|
- lib/generators/rspec/system/system_generator.rb
|
@@ -295,11 +296,11 @@ licenses:
|
|
295
296
|
- MIT
|
296
297
|
metadata:
|
297
298
|
bug_tracker_uri: https://github.com/rspec/rspec-rails/issues
|
298
|
-
changelog_uri: https://github.com/rspec/rspec-rails/blob/v4.0.
|
299
|
+
changelog_uri: https://github.com/rspec/rspec-rails/blob/v4.0.2/Changelog.md
|
299
300
|
documentation_uri: https://rspec.info/documentation/
|
300
301
|
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
301
302
|
source_code_uri: https://github.com/rspec/rspec-rails
|
302
|
-
post_install_message:
|
303
|
+
post_install_message:
|
303
304
|
rdoc_options:
|
304
305
|
- "--charset=UTF-8"
|
305
306
|
require_paths:
|
@@ -308,15 +309,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
308
309
|
requirements:
|
309
310
|
- - ">="
|
310
311
|
- !ruby/object:Gem::Version
|
311
|
-
version:
|
312
|
+
version: 2.2.0
|
312
313
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
313
314
|
requirements:
|
314
|
-
- - "
|
315
|
+
- - ">="
|
315
316
|
- !ruby/object:Gem::Version
|
316
|
-
version:
|
317
|
+
version: '0'
|
317
318
|
requirements: []
|
318
|
-
rubygems_version: 3.
|
319
|
-
signing_key:
|
319
|
+
rubygems_version: 3.1.4
|
320
|
+
signing_key:
|
320
321
|
specification_version: 4
|
321
322
|
summary: RSpec for Rails
|
322
323
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'generators/rspec'
|
2
|
-
|
3
|
-
module Rspec
|
4
|
-
module Generators
|
5
|
-
# @private
|
6
|
-
class ObserverGenerator < Base
|
7
|
-
def generate_observer_spec
|
8
|
-
template 'observer_spec.rb',
|
9
|
-
File.join('spec', 'models', class_path, "#{file_name}_observer_spec.rb")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|