mirror of
https://github.com/drapergem/draper
synced 2023-03-27 23:21:17 -04:00
Fix failing specs re Rails 5.1 (#800)
* Fix failing specs re Rails 5.1 Because there is no hard constraint on Rails version, tests run against the newest version available. Rails 5.1 removes `to_h` from unpermitted parameters class. Using `empty?` is sufficient replacement. * Fix Dummy app `posts#mail` action rendering Rails 5.1 does not accept `:text` key for `render`.
This commit is contained in:
parent
f6a7b17a8a
commit
af7f3a6736
2 changed files with 2 additions and 2 deletions
|
@ -38,7 +38,7 @@ module Draper
|
|||
expect(controller.request).to be_nil
|
||||
strategy.call
|
||||
expect(controller.request).to be_an ActionController::TestRequest
|
||||
expect(controller.params.to_h).to eq({})
|
||||
expect(controller.params).to be_empty
|
||||
|
||||
# sanity checks
|
||||
expect(controller.view_context.request).to be controller.request
|
||||
|
|
|
@ -8,7 +8,7 @@ class PostsController < BaseController
|
|||
def mail
|
||||
post = Post.find(params[:id])
|
||||
email = PostMailer.decorated_email(post).deliver
|
||||
render text: email.body
|
||||
render html: email.body.to_s.html_safe
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in a new issue