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]
def create
params.permit(:name, :username, :email, :password, :stripeToken, :amount)
params.permit(:name, :username, :email, :password, :stripeToken, :amount, :create_account)
output = { 'messages' => [], 'rewards' => [] }

View File

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

View File

@ -24,8 +24,8 @@ module DiscourseDonations
end
it 'whitelists the params' do
params = { 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)
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, :create_account).for(:create, params: params)
end
it 'responds ok for anonymous users' do