1
0
Fork 0
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:
Bartek Bułat 2017-05-05 17:28:28 +02:00 committed by Cliff Braton
parent f6a7b17a8a
commit af7f3a6736
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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