check for empty email

This commit is contained in:
Rimian Perkins 2017-04-05 09:49:57 +10:00
parent 3306c44f1f
commit 66094fdfdd
3 changed files with 4 additions and 6 deletions

View File

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

View File

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

View File

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