Skip to content

Commit

Permalink
Merge pull request #20 from stitchfix/fix-generator-issues
Browse files Browse the repository at this point in the history
Fixes some issues with the generator
  • Loading branch information
davetron5000 committed Nov 20, 2015
2 parents 5ab6742 + 0425a83 commit 5972d0f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions lib/stitches/api_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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(
Expand All @@ -94,4 +96,4 @@ def bootstrap_api

end
end
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'spec_helper'
require 'rails_helper'
require 'rspec_api_documentation/dsl'

resource "Ping (V1)" do
Expand Down
2 changes: 1 addition & 1 deletion lib/stitches/generator_files/spec/features/api_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'spec_helper.rb'
require 'rails_helper.rb'

feature "general API stuff" do
scenario "good request" do
Expand Down

0 comments on commit 5972d0f

Please sign in to comment.