check for empty email
This commit is contained in:
parent
3306c44f1f
commit
66094fdfdd
|
@ -7,10 +7,8 @@ module DiscourseDonations
|
|||
skip_before_filter :verify_authenticity_token, only: [:create]
|
||||
|
||||
def create
|
||||
if email.nil?
|
||||
response = {
|
||||
|
||||
}
|
||||
if email.nil? || email.empty?
|
||||
response = {}
|
||||
else
|
||||
Stripe.api_key = SiteSetting.discourse_donations_secret_key
|
||||
currency = SiteSetting.discourse_donations_currency
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# name: discourse-donations
|
||||
# about: Integrating Discourse with Stripe for donations
|
||||
# version: 1.7.2
|
||||
# version: 1.7.3
|
||||
# url: https://github.com/choiceaustralia/discourse-donations
|
||||
# authors: Rimian Perkins
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ module DiscourseDonations
|
|||
end
|
||||
|
||||
it 'responds ok when the email is empty' do
|
||||
post :create, { }
|
||||
post :create, { email: '' }
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue