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]
|
skip_before_filter :verify_authenticity_token, only: [:create]
|
||||||
|
|
||||||
def create
|
def create
|
||||||
if email.nil?
|
if email.nil? || email.empty?
|
||||||
response = {
|
response = {}
|
||||||
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
Stripe.api_key = SiteSetting.discourse_donations_secret_key
|
Stripe.api_key = SiteSetting.discourse_donations_secret_key
|
||||||
currency = SiteSetting.discourse_donations_currency
|
currency = SiteSetting.discourse_donations_currency
|
||||||
|
|
|
@ -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.7.2
|
# version: 1.7.3
|
||||||
# url: https://github.com/choiceaustralia/discourse-donations
|
# url: https://github.com/choiceaustralia/discourse-donations
|
||||||
# authors: Rimian Perkins
|
# authors: Rimian Perkins
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ module DiscourseDonations
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'responds ok when the email is empty' do
|
it 'responds ok when the email is empty' do
|
||||||
post :create, { }
|
post :create, { email: '' }
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue