Skip to content

Commit 01e9dac

Browse files
klyonradJonRowe
authored andcommitted
Push down code from IntegrationGenerator to RequestGenerator
and break the inheritance. IntegrationGenerator will get a deprecation so the inheritance made no sense.
1 parent da2cbdb commit 01e9dac

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
require 'generators/rspec/integration/integration_generator'
1+
require 'generators/rspec'
22

33
module Rspec
44
module Generators
55
# @private
6-
class RequestGenerator < IntegrationGenerator
6+
class RequestGenerator < Base
7+
class_option :request_specs, type: :boolean, default: true, desc: 'Generate request specs'
8+
79
source_paths << File.expand_path('../integration/templates', __dir__)
10+
11+
def generate_request_spec
12+
return unless options[:request_specs]
13+
14+
template 'request_spec.rb',
15+
File.join('spec/requests', "#{name.underscore.pluralize}_spec.rb")
16+
end
817
end
918
end
1019
end

0 commit comments

Comments
 (0)