Skip to content

Commit 41ecb8b

Browse files
author
Sam Phippen
committed
Make controller testing work in the sample app.
1 parent 4668662 commit 41ecb8b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

example_app_generator/generate_app.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
# edge branches
1616
gsub_file 'Gemfile', /^.*\bgem 'rails.*$/, ''
1717

18+
if Rails::VERSION::STRING >= '5.0.0'
19+
append_to_file('Gemfile', "gem 'rails-controller-testing', :git => 'https://github.com/rails/rails-controller-testing'")
20+
end
21+
1822
# Use our version of RSpec and Rails
1923
append_to_file 'Gemfile', <<-EOT.gsub(/^ +\|/, '')
2024
|# Rack::Cache 1.3.0 requires Ruby >= 2.0.0

example_app_generator/generate_stuff.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,12 @@ def using_source_path(path)
125125
'config.warnings = false'
126126
gsub_file '.rspec', '--warnings', ''
127127

128+
append_to_file 'spec/rails_helper.rb', <<-EOT.gsub(/^ +\|/, '')
129+
|RSpec.configure do |config|
130+
| config.include Rails::Controller::Testing::TestProcess
131+
| config.include Rails::Controller::Testing::TemplateAssertions
132+
| config.include Rails::Controller::Testing::Integration
133+
|end
134+
EOT
135+
128136
final_tasks

0 commit comments

Comments
 (0)