rspec-rails 3.5.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data/Capybara.md +6 -55
- data/Changelog.md +321 -62
- data/README.md +265 -493
- data/lib/generators/rspec/channel/channel_generator.rb +12 -0
- data/lib/generators/rspec/{observer/templates/observer_spec.rb → channel/templates/channel_spec.rb.erb} +1 -1
- data/lib/generators/rspec/controller/controller_generator.rb +21 -4
- data/lib/generators/rspec/controller/templates/request_spec.rb +14 -0
- data/lib/generators/rspec/controller/templates/routing_spec.rb +13 -0
- data/lib/generators/rspec/feature/feature_generator.rb +4 -4
- data/lib/generators/rspec/generator/generator_generator.rb +24 -0
- data/lib/generators/rspec/generator/templates/generator_spec.rb +6 -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 +27 -14
- data/lib/generators/rspec/integration/integration_generator.rb +4 -4
- data/lib/generators/rspec/integration/templates/request_spec.rb +1 -1
- data/lib/generators/rspec/mailbox/mailbox_generator.rb +14 -0
- data/lib/generators/rspec/mailbox/templates/mailbox_spec.rb.erb +7 -0
- data/lib/generators/rspec/mailer/mailer_generator.rb +2 -1
- data/lib/generators/rspec/mailer/templates/mailer_spec.rb +2 -2
- data/lib/generators/rspec/mailer/templates/preview.rb +1 -1
- data/lib/generators/rspec/model/model_generator.rb +6 -5
- data/lib/generators/rspec/model/templates/fixtures.yml +1 -1
- data/lib/generators/rspec/request/request_generator.rb +1 -1
- data/lib/generators/rspec/scaffold/scaffold_generator.rb +52 -86
- data/lib/generators/rspec/scaffold/templates/api_controller_spec.rb +129 -0
- data/lib/generators/rspec/scaffold/templates/api_request_spec.rb +131 -0
- data/lib/generators/rspec/scaffold/templates/controller_spec.rb +40 -74
- data/lib/generators/rspec/scaffold/templates/edit_spec.rb +5 -1
- data/lib/generators/rspec/scaffold/templates/index_spec.rb +2 -2
- data/lib/generators/rspec/scaffold/templates/new_spec.rb +5 -1
- data/lib/generators/rspec/scaffold/templates/request_spec.rb +133 -0
- data/lib/generators/rspec/scaffold/templates/routing_spec.rb +13 -12
- data/lib/generators/rspec/scaffold/templates/show_spec.rb +1 -1
- 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/view_generator.rb +2 -2
- data/lib/generators/rspec.rb +0 -6
- data/lib/rspec/rails/active_record.rb +1 -1
- data/lib/rspec/rails/adapters.rb +11 -76
- data/lib/rspec/rails/configuration.rb +47 -31
- data/lib/rspec/rails/example/channel_example_group.rb +93 -0
- 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 -9
- data/lib/rspec/rails/example/mailbox_example_group.rb +80 -0
- data/lib/rspec/rails/example/mailer_example_group.rb +1 -1
- data/lib/rspec/rails/example/rails_example_group.rb +1 -2
- data/lib/rspec/rails/example/request_example_group.rb +1 -3
- data/lib/rspec/rails/example/system_example_group.rb +124 -0
- data/lib/rspec/rails/example/view_example_group.rb +47 -28
- data/lib/rspec/rails/example.rb +3 -0
- data/lib/rspec/rails/extensions/active_record/proxy.rb +1 -9
- data/lib/rspec/rails/feature_check.rb +12 -29
- data/lib/rspec/rails/fixture_file_upload_support.rb +40 -0
- data/lib/rspec/rails/fixture_support.rb +37 -31
- data/lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb +170 -0
- data/lib/rspec/rails/matchers/action_cable/have_streams.rb +58 -0
- data/lib/rspec/rails/matchers/action_cable.rb +65 -0
- data/lib/rspec/rails/matchers/action_mailbox.rb +64 -0
- data/lib/rspec/rails/matchers/active_job.rb +208 -18
- data/lib/rspec/rails/matchers/base_matcher.rb +179 -0
- data/lib/rspec/rails/matchers/be_a_new.rb +8 -7
- data/lib/rspec/rails/matchers/be_new_record.rb +3 -3
- data/lib/rspec/rails/matchers/be_valid.rb +1 -1
- data/lib/rspec/rails/matchers/have_enqueued_mail.rb +198 -0
- data/lib/rspec/rails/matchers/have_http_status.rb +34 -13
- data/lib/rspec/rails/matchers/have_rendered.rb +2 -1
- data/lib/rspec/rails/matchers/redirect_to.rb +1 -1
- data/lib/rspec/rails/matchers/routing_matchers.rb +14 -14
- data/lib/rspec/rails/matchers.rb +11 -0
- data/lib/rspec/rails/tasks/rspec.rake +7 -17
- data/lib/rspec/rails/vendor/capybara.rb +12 -13
- data/lib/rspec/rails/version.rb +1 -1
- data/lib/rspec/rails/view_path_builder.rb +2 -2
- data/lib/rspec/rails/view_rendering.rb +18 -5
- data/lib/rspec/rails.rb +1 -0
- data/lib/rspec-rails.rb +17 -11
- data.tar.gz.sig +0 -0
- metadata +57 -33
- metadata.gz.sig +0 -0
- data/lib/generators/rspec/observer/observer_generator.rb +0 -13
@@ -6,7 +6,7 @@ module RSpec
|
|
6
6
|
extend RSpec::Matchers::DSL
|
7
7
|
|
8
8
|
# @private
|
9
|
-
class RouteToMatcher < RSpec::Matchers::
|
9
|
+
class RouteToMatcher < RSpec::Rails::Matchers::BaseMatcher
|
10
10
|
def initialize(scope, *expected)
|
11
11
|
@scope = scope
|
12
12
|
@expected = expected[1] || {}
|
@@ -14,7 +14,7 @@ module RSpec
|
|
14
14
|
@expected.merge!(expected[0])
|
15
15
|
else
|
16
16
|
controller, action = expected[0].split('#')
|
17
|
-
@expected.merge!(:
|
17
|
+
@expected.merge!(controller: controller, action: action)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -26,7 +26,7 @@ module RSpec
|
|
26
26
|
path, query = *verb_to_path_map.values.first.split('?')
|
27
27
|
@scope.assert_recognizes(
|
28
28
|
@expected,
|
29
|
-
{
|
29
|
+
{method: verb_to_path_map.keys.first, path: path},
|
30
30
|
Rack::Utils.parse_nested_query(query)
|
31
31
|
)
|
32
32
|
end
|
@@ -50,20 +50,20 @@ module RSpec
|
|
50
50
|
#
|
51
51
|
# @example
|
52
52
|
#
|
53
|
-
# expect(:
|
54
|
-
# :
|
55
|
-
# :
|
53
|
+
# expect(get: "/things/special").to route_to(
|
54
|
+
# controller: "things",
|
55
|
+
# action: "special"
|
56
56
|
# )
|
57
57
|
#
|
58
|
-
# expect(:
|
58
|
+
# expect(get: "/things/special").to route_to("things#special")
|
59
59
|
#
|
60
|
-
# @see
|
60
|
+
# @see https://api.rubyonrails.org/classes/ActionDispatch/Assertions/RoutingAssertions.html#method-i-assert_recognizes
|
61
61
|
def route_to(*expected)
|
62
62
|
RouteToMatcher.new(self, *expected)
|
63
63
|
end
|
64
64
|
|
65
65
|
# @private
|
66
|
-
class BeRoutableMatcher < RSpec::Matchers::
|
66
|
+
class BeRoutableMatcher < RSpec::Rails::Matchers::BaseMatcher
|
67
67
|
def initialize(scope)
|
68
68
|
@scope = scope
|
69
69
|
end
|
@@ -72,7 +72,7 @@ module RSpec
|
|
72
72
|
@actual = path
|
73
73
|
match_unless_raises ActionController::RoutingError do
|
74
74
|
@routing_options = @scope.routes.recognize_path(
|
75
|
-
path.values.first, :
|
75
|
+
path.values.first, method: path.keys.first
|
76
76
|
)
|
77
77
|
end
|
78
78
|
end
|
@@ -95,9 +95,9 @@ module RSpec
|
|
95
95
|
# `RouteSet#recognize_path`.
|
96
96
|
#
|
97
97
|
# @example You can use route helpers provided by rspec-rails.
|
98
|
-
# expect(:
|
99
|
-
# expect(:
|
100
|
-
# expect(:
|
98
|
+
# expect(get: "/a/path").to be_routable
|
99
|
+
# expect(post: "/another/path").to be_routable
|
100
|
+
# expect(put: "/yet/another/path").to be_routable
|
101
101
|
def be_routable
|
102
102
|
BeRoutableMatcher.new(self)
|
103
103
|
end
|
@@ -115,7 +115,7 @@ module RSpec
|
|
115
115
|
# Shorthand method for matching this type of route.
|
116
116
|
%w[get post put patch delete options head].each do |method|
|
117
117
|
define_method method do |path|
|
118
|
-
{
|
118
|
+
{method.to_sym => path}
|
119
119
|
end
|
120
120
|
end
|
121
121
|
end
|
data/lib/rspec/rails/matchers.rb
CHANGED
@@ -11,6 +11,7 @@ module RSpec
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
require 'rspec/rails/matchers/base_matcher'
|
14
15
|
require 'rspec/rails/matchers/have_rendered'
|
15
16
|
require 'rspec/rails/matchers/redirect_to'
|
16
17
|
require 'rspec/rails/matchers/routing_matchers'
|
@@ -19,6 +20,16 @@ require 'rspec/rails/matchers/be_a_new'
|
|
19
20
|
require 'rspec/rails/matchers/relation_match_array'
|
20
21
|
require 'rspec/rails/matchers/be_valid'
|
21
22
|
require 'rspec/rails/matchers/have_http_status'
|
23
|
+
|
22
24
|
if RSpec::Rails::FeatureCheck.has_active_job?
|
23
25
|
require 'rspec/rails/matchers/active_job'
|
26
|
+
require 'rspec/rails/matchers/have_enqueued_mail'
|
27
|
+
end
|
28
|
+
|
29
|
+
if RSpec::Rails::FeatureCheck.has_action_cable_testing?
|
30
|
+
require 'rspec/rails/matchers/action_cable'
|
31
|
+
end
|
32
|
+
|
33
|
+
if RSpec::Rails::FeatureCheck.has_action_mailbox?
|
34
|
+
require 'rspec/rails/matchers/action_mailbox'
|
24
35
|
end
|
@@ -3,19 +3,19 @@ if default = Rake.application.instance_variable_get('@tasks')['default']
|
|
3
3
|
default.prerequisites.delete('test')
|
4
4
|
end
|
5
5
|
|
6
|
-
task :
|
6
|
+
task default: :spec
|
7
7
|
|
8
|
-
task :
|
8
|
+
task stats: "spec:statsetup"
|
9
9
|
|
10
10
|
desc "Run all specs in spec directory (excluding plugin specs)"
|
11
|
-
RSpec::Core::RakeTask.new(:
|
11
|
+
RSpec::Core::RakeTask.new(spec: "spec:prepare")
|
12
12
|
|
13
13
|
namespace :spec do
|
14
14
|
types = begin
|
15
|
-
dirs = Dir['./spec/**/*_spec.rb']
|
16
|
-
map { |f| f.sub(/^\.\/(spec\/\w+)\/.*/, '\\1') }
|
17
|
-
uniq
|
18
|
-
select { |f| File.directory?(f) }
|
15
|
+
dirs = Dir['./spec/**/*_spec.rb']
|
16
|
+
.map { |f| f.sub(/^\.\/(spec\/\w+)\/.*/, '\\1') }
|
17
|
+
.uniq
|
18
|
+
.select { |f| File.directory?(f) }
|
19
19
|
Hash[dirs.map { |d| [d.split('/').last, d] }]
|
20
20
|
end
|
21
21
|
|
@@ -35,16 +35,6 @@ namespace :spec do
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
# RCov task only enabled for Ruby 1.8
|
39
|
-
if RUBY_VERSION < '1.9'
|
40
|
-
desc "Run all specs with rcov"
|
41
|
-
RSpec::Core::RakeTask.new(:rcov => "spec:prepare") do |t|
|
42
|
-
t.rcov = true
|
43
|
-
t.pattern = "./spec/**/*_spec.rb"
|
44
|
-
t.rcov_opts = '--exclude /gems/,/Library/,/usr/,lib/tasks,.bundle,config,/lib/rspec/,/lib/rspec-,spec'
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
38
|
task :statsetup do
|
49
39
|
require 'rails/code_statistics'
|
50
40
|
types.each do |type, dir|
|
@@ -9,27 +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
|
15
|
+
if defined?(ActionPack) && ActionPack::VERSION::STRING >= "5.1"
|
16
|
+
c.include Capybara::DSL, type: :system
|
17
|
+
end
|
20
18
|
end
|
21
19
|
|
22
20
|
if defined?(Capybara::RSpecMatchers)
|
23
|
-
c.include Capybara::RSpecMatchers, :
|
24
|
-
c.include Capybara::RSpecMatchers, :
|
25
|
-
c.include Capybara::RSpecMatchers, :
|
26
|
-
c.include Capybara::RSpecMatchers, :
|
27
|
-
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
|
28
27
|
end
|
29
28
|
|
30
29
|
unless defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL)
|
31
|
-
c.include Capybara, :
|
32
|
-
c.include Capybara, :
|
30
|
+
c.include Capybara, type: :request
|
31
|
+
c.include Capybara, type: :controller
|
33
32
|
end
|
34
33
|
end
|
35
34
|
end
|
data/lib/rspec/rails/version.rb
CHANGED
@@ -18,9 +18,9 @@ module RSpec
|
|
18
18
|
# @example
|
19
19
|
# # path cannot be built because the params are missing a required element (:id)
|
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,12 +55,23 @@ module RSpec
|
|
55
55
|
"",
|
56
56
|
template.identifier,
|
57
57
|
EmptyTemplateHandler,
|
58
|
-
:
|
59
|
-
:
|
58
|
+
virtual_path: template.virtual_path,
|
59
|
+
format: template_format(template),
|
60
|
+
locals: []
|
60
61
|
)
|
61
62
|
end
|
62
63
|
end
|
63
64
|
|
65
|
+
if ::Rails::VERSION::STRING >= '6'
|
66
|
+
def self.template_format(template)
|
67
|
+
template.format
|
68
|
+
end
|
69
|
+
else
|
70
|
+
def self.template_format(template)
|
71
|
+
template.formats
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
64
75
|
# Delegates all methods to the submitted resolver and for all methods
|
65
76
|
# that return a collection of `ActionView::Template` instances, return
|
66
77
|
# templates with modified source
|
@@ -91,7 +102,7 @@ module RSpec
|
|
91
102
|
#
|
92
103
|
# @private
|
93
104
|
class FileSystemResolver < ::ActionView::FileSystemResolver
|
94
|
-
|
105
|
+
private
|
95
106
|
|
96
107
|
def find_templates(*args)
|
97
108
|
templates = super
|
@@ -102,7 +113,9 @@ module RSpec
|
|
102
113
|
|
103
114
|
# @private
|
104
115
|
class EmptyTemplateHandler
|
105
|
-
def self.call(_template)
|
116
|
+
def self.call(_template, _source = nil)
|
117
|
+
::Rails.logger.info(" Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.")
|
118
|
+
|
106
119
|
%("")
|
107
120
|
end
|
108
121
|
end
|
@@ -135,7 +148,7 @@ module RSpec
|
|
135
148
|
before do
|
136
149
|
unless render_views?
|
137
150
|
@_original_path_set = controller.class.view_paths
|
138
|
-
path_set = @_original_path_set.map { |resolver| RESOLVER_CACHE[resolver
|
151
|
+
path_set = @_original_path_set.map { |resolver| RESOLVER_CACHE[resolver] }
|
139
152
|
|
140
153
|
controller.class.view_paths = path_set
|
141
154
|
controller.extend(EmptyTemplates)
|
data/lib/rspec/rails.rb
CHANGED
@@ -10,6 +10,7 @@ require 'rspec/rails/view_rendering'
|
|
10
10
|
require 'rspec/rails/matchers'
|
11
11
|
require 'rspec/rails/fixture_support'
|
12
12
|
require 'rspec/rails/file_fixture_support'
|
13
|
+
require 'rspec/rails/fixture_file_upload_support'
|
13
14
|
require 'rspec/rails/example'
|
14
15
|
require 'rspec/rails/vendor/capybara'
|
15
16
|
require 'rspec/rails/configuration'
|
data/lib/rspec-rails.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# Explicitly require rspec-core for weird spring issue, see #1558
|
2
|
-
require 'rspec/core'
|
3
1
|
require 'rspec/rails/feature_check'
|
4
2
|
|
5
3
|
# Namespace for all core RSpec projects.
|
@@ -8,8 +6,16 @@ module RSpec
|
|
8
6
|
module Rails
|
9
7
|
# Railtie to hook into Rails.
|
10
8
|
class Railtie < ::Rails::Railtie
|
11
|
-
# Rails
|
12
|
-
|
9
|
+
# As of Rails 5.1.0 you can register directories to work with `rake notes`
|
10
|
+
if ::Rails::VERSION::STRING >= '5.1'
|
11
|
+
require 'rails/source_annotation_extractor'
|
12
|
+
if ::Rails::VERSION::STRING >= '6.0'
|
13
|
+
::Rails::SourceAnnotationExtractor::Annotation.register_directories("spec")
|
14
|
+
else
|
15
|
+
SourceAnnotationExtractor::Annotation.register_directories("spec")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
generators = config.app_generators
|
13
19
|
generators.integration_tool :rspec
|
14
20
|
generators.test_framework :rspec
|
15
21
|
|
@@ -24,14 +30,15 @@ module RSpec
|
|
24
30
|
# This is called after the environment has been loaded but before Rails
|
25
31
|
# sets the default for the `preview_path`
|
26
32
|
initializer "rspec_rails.action_mailer",
|
27
|
-
:
|
28
|
-
|
29
|
-
|
33
|
+
before: "action_mailer.set_configs" do |app|
|
34
|
+
setup_preview_path(app)
|
35
|
+
end
|
30
36
|
|
31
37
|
private
|
32
38
|
|
33
39
|
def setup_preview_path(app)
|
34
40
|
return unless supports_action_mailer_previews?(app.config)
|
41
|
+
|
35
42
|
options = app.config.action_mailer
|
36
43
|
config_default_preview_path(options) if config_preview_path?(options)
|
37
44
|
end
|
@@ -39,9 +46,7 @@ module RSpec
|
|
39
46
|
def config_preview_path?(options)
|
40
47
|
# We cannot use `respond_to?(:show_previews)` here as it will always
|
41
48
|
# return `true`.
|
42
|
-
if
|
43
|
-
::Rails.env.development?
|
44
|
-
elsif options.show_previews.nil?
|
49
|
+
if options.show_previews.nil?
|
45
50
|
options.show_previews = ::Rails.env.development?
|
46
51
|
else
|
47
52
|
options.show_previews
|
@@ -50,6 +55,7 @@ module RSpec
|
|
50
55
|
|
51
56
|
def config_default_preview_path(options)
|
52
57
|
return unless options.preview_path.blank?
|
58
|
+
|
53
59
|
options.preview_path = "#{::Rails.root}/spec/mailers/previews"
|
54
60
|
end
|
55
61
|
|
@@ -65,7 +71,7 @@ module RSpec
|
|
65
71
|
# not respond to the method. However, we cannot use
|
66
72
|
# `config.action_mailer.respond_to?(:preview_path)` here as it will
|
67
73
|
# always return `true`.
|
68
|
-
config.respond_to?(:action_mailer)
|
74
|
+
config.respond_to?(:action_mailer)
|
69
75
|
end
|
70
76
|
end
|
71
77
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chelimsky
|
@@ -44,149 +44,149 @@ cert_chain:
|
|
44
44
|
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
45
45
|
F3MdtaDehhjC
|
46
46
|
-----END CERTIFICATE-----
|
47
|
-
date:
|
47
|
+
date: 2020-03-24 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
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '4.2'
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
58
|
version_requirements: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
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
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
69
|
+
version: '4.2'
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
76
|
+
version: '4.2'
|
77
77
|
- !ruby/object:Gem::Dependency
|
78
78
|
name: railties
|
79
79
|
requirement: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
83
|
+
version: '4.2'
|
84
84
|
type: :runtime
|
85
85
|
prerelease: false
|
86
86
|
version_requirements: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - ">="
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: '
|
90
|
+
version: '4.2'
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: rspec-core
|
93
93
|
requirement: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: 3.
|
97
|
+
version: '3.9'
|
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.9'
|
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.9'
|
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.9'
|
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.9'
|
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.9'
|
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.9'
|
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.9'
|
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: []
|
@@ -199,12 +199,18 @@ files:
|
|
199
199
|
- LICENSE.md
|
200
200
|
- README.md
|
201
201
|
- lib/generators/rspec.rb
|
202
|
+
- lib/generators/rspec/channel/channel_generator.rb
|
203
|
+
- lib/generators/rspec/channel/templates/channel_spec.rb.erb
|
202
204
|
- lib/generators/rspec/controller/controller_generator.rb
|
203
205
|
- lib/generators/rspec/controller/templates/controller_spec.rb
|
206
|
+
- lib/generators/rspec/controller/templates/request_spec.rb
|
207
|
+
- lib/generators/rspec/controller/templates/routing_spec.rb
|
204
208
|
- lib/generators/rspec/controller/templates/view_spec.rb
|
205
209
|
- lib/generators/rspec/feature/feature_generator.rb
|
206
210
|
- lib/generators/rspec/feature/templates/feature_singular_spec.rb
|
207
211
|
- lib/generators/rspec/feature/templates/feature_spec.rb
|
212
|
+
- lib/generators/rspec/generator/generator_generator.rb
|
213
|
+
- lib/generators/rspec/generator/templates/generator_spec.rb
|
208
214
|
- lib/generators/rspec/helper/helper_generator.rb
|
209
215
|
- lib/generators/rspec/helper/templates/helper_spec.rb
|
210
216
|
- lib/generators/rspec/install/install_generator.rb
|
@@ -213,6 +219,8 @@ files:
|
|
213
219
|
- lib/generators/rspec/integration/templates/request_spec.rb
|
214
220
|
- lib/generators/rspec/job/job_generator.rb
|
215
221
|
- lib/generators/rspec/job/templates/job_spec.rb.erb
|
222
|
+
- lib/generators/rspec/mailbox/mailbox_generator.rb
|
223
|
+
- lib/generators/rspec/mailbox/templates/mailbox_spec.rb.erb
|
216
224
|
- lib/generators/rspec/mailer/mailer_generator.rb
|
217
225
|
- lib/generators/rspec/mailer/templates/fixture
|
218
226
|
- lib/generators/rspec/mailer/templates/mailer_spec.rb
|
@@ -220,16 +228,19 @@ files:
|
|
220
228
|
- lib/generators/rspec/model/model_generator.rb
|
221
229
|
- lib/generators/rspec/model/templates/fixtures.yml
|
222
230
|
- lib/generators/rspec/model/templates/model_spec.rb
|
223
|
-
- lib/generators/rspec/observer/observer_generator.rb
|
224
|
-
- lib/generators/rspec/observer/templates/observer_spec.rb
|
225
231
|
- lib/generators/rspec/request/request_generator.rb
|
226
232
|
- lib/generators/rspec/scaffold/scaffold_generator.rb
|
233
|
+
- lib/generators/rspec/scaffold/templates/api_controller_spec.rb
|
234
|
+
- lib/generators/rspec/scaffold/templates/api_request_spec.rb
|
227
235
|
- lib/generators/rspec/scaffold/templates/controller_spec.rb
|
228
236
|
- lib/generators/rspec/scaffold/templates/edit_spec.rb
|
229
237
|
- lib/generators/rspec/scaffold/templates/index_spec.rb
|
230
238
|
- lib/generators/rspec/scaffold/templates/new_spec.rb
|
239
|
+
- lib/generators/rspec/scaffold/templates/request_spec.rb
|
231
240
|
- lib/generators/rspec/scaffold/templates/routing_spec.rb
|
232
241
|
- lib/generators/rspec/scaffold/templates/show_spec.rb
|
242
|
+
- lib/generators/rspec/system/system_generator.rb
|
243
|
+
- lib/generators/rspec/system/templates/system_spec.rb
|
233
244
|
- lib/generators/rspec/view/templates/view_spec.rb
|
234
245
|
- lib/generators/rspec/view/view_generator.rb
|
235
246
|
- lib/rspec-rails.rb
|
@@ -238,26 +249,36 @@ files:
|
|
238
249
|
- lib/rspec/rails/adapters.rb
|
239
250
|
- lib/rspec/rails/configuration.rb
|
240
251
|
- lib/rspec/rails/example.rb
|
252
|
+
- lib/rspec/rails/example/channel_example_group.rb
|
241
253
|
- lib/rspec/rails/example/controller_example_group.rb
|
242
254
|
- lib/rspec/rails/example/feature_example_group.rb
|
243
255
|
- lib/rspec/rails/example/helper_example_group.rb
|
244
256
|
- lib/rspec/rails/example/job_example_group.rb
|
257
|
+
- lib/rspec/rails/example/mailbox_example_group.rb
|
245
258
|
- lib/rspec/rails/example/mailer_example_group.rb
|
246
259
|
- lib/rspec/rails/example/model_example_group.rb
|
247
260
|
- lib/rspec/rails/example/rails_example_group.rb
|
248
261
|
- lib/rspec/rails/example/request_example_group.rb
|
249
262
|
- lib/rspec/rails/example/routing_example_group.rb
|
263
|
+
- lib/rspec/rails/example/system_example_group.rb
|
250
264
|
- lib/rspec/rails/example/view_example_group.rb
|
251
265
|
- lib/rspec/rails/extensions.rb
|
252
266
|
- lib/rspec/rails/extensions/active_record/proxy.rb
|
253
267
|
- lib/rspec/rails/feature_check.rb
|
254
268
|
- lib/rspec/rails/file_fixture_support.rb
|
269
|
+
- lib/rspec/rails/fixture_file_upload_support.rb
|
255
270
|
- lib/rspec/rails/fixture_support.rb
|
256
271
|
- lib/rspec/rails/matchers.rb
|
272
|
+
- lib/rspec/rails/matchers/action_cable.rb
|
273
|
+
- lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb
|
274
|
+
- lib/rspec/rails/matchers/action_cable/have_streams.rb
|
275
|
+
- lib/rspec/rails/matchers/action_mailbox.rb
|
257
276
|
- lib/rspec/rails/matchers/active_job.rb
|
277
|
+
- lib/rspec/rails/matchers/base_matcher.rb
|
258
278
|
- lib/rspec/rails/matchers/be_a_new.rb
|
259
279
|
- lib/rspec/rails/matchers/be_new_record.rb
|
260
280
|
- lib/rspec/rails/matchers/be_valid.rb
|
281
|
+
- lib/rspec/rails/matchers/have_enqueued_mail.rb
|
261
282
|
- lib/rspec/rails/matchers/have_http_status.rb
|
262
283
|
- lib/rspec/rails/matchers/have_rendered.rb
|
263
284
|
- lib/rspec/rails/matchers/redirect_to.rb
|
@@ -273,7 +294,12 @@ files:
|
|
273
294
|
homepage: https://github.com/rspec/rspec-rails
|
274
295
|
licenses:
|
275
296
|
- MIT
|
276
|
-
metadata:
|
297
|
+
metadata:
|
298
|
+
bug_tracker_uri: https://github.com/rspec/rspec-rails/issues
|
299
|
+
changelog_uri: https://github.com/rspec/rspec-rails/blob/v4.0.0/Changelog.md
|
300
|
+
documentation_uri: https://rspec.info/documentation/
|
301
|
+
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
302
|
+
source_code_uri: https://github.com/rspec/rspec-rails
|
277
303
|
post_install_message:
|
278
304
|
rdoc_options:
|
279
305
|
- "--charset=UTF-8"
|
@@ -290,10 +316,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
290
316
|
- !ruby/object:Gem::Version
|
291
317
|
version: '0'
|
292
318
|
requirements: []
|
293
|
-
|
294
|
-
rubygems_version: 2.5.1
|
319
|
+
rubygems_version: 3.1.2
|
295
320
|
signing_key:
|
296
321
|
specification_version: 4
|
297
322
|
summary: RSpec for Rails
|
298
323
|
test_files: []
|
299
|
-
has_rdoc:
|
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
|