Skip to content

Bring RSpec current with rails 5 beta 3 #1573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ matrix:
- rvm: 2.2.2
env: RAILS_VERSION=master
- rvm: 2.2.2
env: RAILS_VERSION=5.0.0.beta2
env: RAILS_VERSION=5.0.0.beta3
- rvm: 2.3.0
env: RAILS_VERSION=master
- rvm: 2.3.0
env: RAILS_VERSION=5.0.0.beta2
env: RAILS_VERSION=5.0.0.beta3
exclude:
# 3.0.x is not supported on MRI 2.0+
- rvm: 2.0.0
Expand Down
1 change: 1 addition & 0 deletions example_app_generator/generate_action_mailer_specs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def comment_lines(path, flag, *args)
comment_lines 'config/environments/test.rb', /action_mailer/

initializer 'action_mailer.rb', <<-CODE
require "action_view/base"
if ENV['DEFAULT_URL']
if ::Rails::VERSION::STRING < '4.1'
ExampleApp::Application.configure do
Expand Down
2 changes: 2 additions & 0 deletions example_app_generator/generate_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
function_script_file = File.join(rspec_rails_repo_path, 'script/functions.sh')

in_root do
prepend_to_file "Rakefile", "require 'active_support/all'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's totally because rails isn't requiring this properly itself in our sample app, nothing we can really do here :/


# Remove the existing rails version so we can properly use master or other
# edge branches
gsub_file 'Gemfile', /^.*\bgem 'rails.*$/, ''
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/rspec/mailer/templates/preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class <%= class_name %>Preview < ActionMailer::Preview

# Preview this email at http://localhost:3000/rails/mailers/<%= file_path %>/<%= action %>
def <%= action %>
<%= class_name %>.<%= action %>
<%= class_name %><%= Rails.version.to_f >= 5.0 ? "Mailer" : "" %>.<%= action %>
end
<% end -%>

Expand Down