Skip to content

Commit 4cb18df

Browse files
Sam Phippensgrif
authored andcommitted
Further rails 5 fixes.
πŸ’˜A πŸ’™ πŸ’š πŸ’› πŸ’œ
1 parent f313588 commit 4cb18df

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

β€ŽGemfile-rails-dependencies

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ when /master/
66
gem "journey", :git => "git://github.com/rails/journey.git"
77
gem "activerecord-deprecated_finders", :git => "git://github.com/rails/activerecord-deprecated_finders.git"
88
gem "rails-observers", :git => "git://github.com/rails/rails-observers"
9+
gem "web-console", :git => "git://github.com/rails/web-console"
910
gem 'sass-rails', :git => "git://github.com/rails/sass-rails.git"
1011
gem 'coffee-rails', :git => "git://github.com/rails/coffee-rails.git"
1112
gem 'rack', :git => 'git://github.com/rack/rack.git'
@@ -14,15 +15,18 @@ when /master/
1415
gem 'sprockets-rails', :git => 'git://github.com/rails/sprockets-rails.git', :branch => 'master'
1516
when /stable$/
1617
gem "rails", :git => "git://github.com/rails/rails.git", :branch => version
18+
gem 'web-console', '~> 2.0'
1719
when nil, false, ""
1820
if RUBY_VERSION < '1.9.3'
1921
# Rails 4+ requires 1.9.3+, so on earlier versions default to the last 3.x release.
2022
gem "rails", "~> 3.2.17"
2123
else
2224
gem "rails", "~> 4.0.4"
2325
end
26+
gem 'web-console', '~> 2.0'
2427
else
2528
gem "rails", version
29+
gem 'web-console', '~> 2.0'
2630
end
2731

2832
gem "i18n", '< 0.7.0' if RUBY_VERSION < '1.9.3'

β€Žexample_app_generator/generate_app.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# Remove the existing rails version so we can properly use master or other
1515
# edge branches
1616
gsub_file 'Gemfile', /^.*\bgem 'rails.*$/, ''
17+
gsub_file "Gemfile", /.*web-console.*/, ''
1718

1819
if Rails::VERSION::STRING >= '5.0.0'
1920
append_to_file('Gemfile', "gem 'rails-controller-testing', :git => 'https://github.com/rails/rails-controller-testing'")

β€Žexample_app_generator/generate_stuff.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ def using_source_path(path)
127127

128128
append_to_file 'spec/rails_helper.rb', <<-EOT.gsub(/^ +\|/, '')
129129
|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
130+
| [:controller, :view, :request].each do |type|
131+
| config.include Rails::Controller::Testing::TestProcess, :type => type
132+
| config.include Rails::Controller::Testing::TemplateAssertions, :type => type
133+
| config.include Rails::Controller::Testing::Integration, :type => type
134+
| end
133135
|end
134136
EOT
135137

β€Žfeatures/controller_specs/render_views.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Feature: render_views
1212
render_views
1313
1414
describe "GET index" do
15-
it "says 'Listing widgets'" do
15+
it "has a widgets related heading" do
1616
get :index
17-
expect(response.body).to match /Listing widgets/im
17+
expect(response.body).to match /<h1>.*widgets/im
1818
end
1919
end
2020
end
@@ -34,7 +34,7 @@ Feature: render_views
3434
describe "GET index" do
3535
it "renders the actual template" do
3636
get :index
37-
expect(response.body).to match /Listing widgets/im
37+
expect(response.body).to match /<h1>.*widgets/im
3838
end
3939
end
4040
@@ -65,7 +65,7 @@ Feature: render_views
6565
describe "GET index" do
6666
it "renders the actual template" do
6767
get :index
68-
expect(response.body).to match /Listing widgets/im
68+
expect(response.body).to match /<h1>.*widgets/im
6969
end
7070
end
7171
end
@@ -105,7 +105,7 @@ Feature: render_views
105105
describe "GET index" do
106106
it "renders the index template" do
107107
get :index
108-
expect(response.body).to match /Listing widgets/im
108+
expect(response.body).to match /<h1>.*widgets/im
109109
end
110110
end
111111
end

β€Žfeatures/mailer_specs/url_helpers.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Feature: URL helpers in mailer examples
1212
"""ruby
1313
require 'rails_helper'
1414
15-
RSpec.describe Notifications, :type => :mailer do
15+
RSpec.describe NotificationsMailer, :type => :mailer do
1616
it 'should have access to URL helpers' do
1717
expect { gadgets_url }.not_to raise_error
1818
end
@@ -30,7 +30,7 @@ Feature: URL helpers in mailer examples
3030
"""ruby
3131
require 'rails_helper'
3232
33-
RSpec.describe Notifications, :type => :mailer do
33+
RSpec.describe NotificationsMailer, :type => :mailer do
3434
it 'should have access to URL helpers' do
3535
expect { gadgets_url :host => 'example.com' }.not_to raise_error
3636
expect { gadgets_url }.to raise_error

0 commit comments

Comments
Β (0)