fix missing strong param

This commit is contained in:
Rimian Perkins 2017-05-23 14:32:52 +10:00
parent 9d2cd86f54
commit 17a43740d6
3 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ module DiscourseDonations
skip_before_filter :verify_authenticity_token, only: [:create] skip_before_filter :verify_authenticity_token, only: [:create]
def create def create
params.permit(:name, :username, :email, :password, :stripeToken, :amount) params.permit(:name, :username, :email, :password, :stripeToken, :amount, :create_account)
output = { 'messages' => [], 'rewards' => [] } output = { 'messages' => [], 'rewards' => [] }

View File

@ -1,6 +1,6 @@
# name: discourse-donations # name: discourse-donations
# about: Integrating Discourse with Stripe for donations # about: Integrating Discourse with Stripe for donations
# version: 1.10.0 # version: 1.10.1
# url: https://github.com/choiceaustralia/discourse-donations # url: https://github.com/choiceaustralia/discourse-donations
# authors: Rimian Perkins # authors: Rimian Perkins

View File

@ -24,8 +24,8 @@ module DiscourseDonations
end end
it 'whitelists the params' do it 'whitelists the params' do
params = { email: 'email@example.com', password: 'secret', username: 'mr-pink', name: 'kirsten', amount: 100, stripeToken: 'rrurrrurrrrr' } params = { create_account: 'true', email: 'email@example.com', password: 'secret', username: 'mr-pink', name: 'kirsten', amount: 100, stripeToken: 'rrurrrurrrrr' }
should permit(:name, :username, :email, :password).for(:create, params: params) should permit(:name, :username, :email, :password, :create_account).for(:create, params: params)
end end
it 'responds ok for anonymous users' do it 'responds ok for anonymous users' do