diff --git a/lib/stitches/api_generator.rb b/lib/stitches/api_generator.rb index e4b885e..a35705b 100644 --- a/lib/stitches/api_generator.rb +++ b/lib/stitches/api_generator.rb @@ -53,7 +53,8 @@ def bootstrap_api inject_into_file "Gemfile", after: /^group :test, :development do.*$/ do<<-GEM -gem "rspec_api_documentation" + gem "rspec_api_documentation" + gem "capybara" GEM end run 'bundle install' @@ -62,16 +63,17 @@ def bootstrap_api sleep 1 # allow clock to tick so we get different numbers migration_template "db/migrate/create_api_clients.rb", "db/migrate/create_api_clients.rb" - inject_into_file 'spec/spec_helper.rb', %q{ + inject_into_file 'spec/rails_helper.rb', %q{ config.include RSpec::Rails::RequestExampleGroup, type: :feature }, before: /^end/ - inject_into_file 'spec/spec_helper.rb', before: /^RSpec.configure/ do<<-REQUIRE + inject_into_file 'spec/rails_helper.rb', before: /^RSpec.configure/ do<<-REQUIRE require 'stitches/spec' REQUIRE end - append_to_file 'spec/spec_helper.rb' do<<-RSPEC_API + append_to_file 'spec/rails_helper.rb' do<<-RSPEC_API +require 'rspec_api_documentation' RspecApiDocumentation.configure do |config| config.format = :json config.request_headers_to_include = %w( @@ -94,4 +96,4 @@ def bootstrap_api end end -end \ No newline at end of file +end diff --git a/lib/stitches/generator_files/spec/acceptance/ping_v1_spec.rb b/lib/stitches/generator_files/spec/acceptance/ping_v1_spec.rb index 603859d..4ce42f2 100644 --- a/lib/stitches/generator_files/spec/acceptance/ping_v1_spec.rb +++ b/lib/stitches/generator_files/spec/acceptance/ping_v1_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' +require 'rails_helper' require 'rspec_api_documentation/dsl' resource "Ping (V1)" do diff --git a/lib/stitches/generator_files/spec/features/api_spec.rb b/lib/stitches/generator_files/spec/features/api_spec.rb index 76bc03e..3efaf39 100644 --- a/lib/stitches/generator_files/spec/features/api_spec.rb +++ b/lib/stitches/generator_files/spec/features/api_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper.rb' +require 'rails_helper.rb' feature "general API stuff" do scenario "good request" do