diff --git a/app/models/user.rb b/app/models/user.rb index b7c05860..7c42fd76 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -65,14 +65,14 @@ def email_required? def recipient_label if nickname.present? nickname - elsif identifier.present? - identifier elsif email.present? if new_record? "#{email} (new user)" else email end + elsif identifier.present? + identifier else "Unknown user" end diff --git a/features/distribution.feature b/features/distribution.feature index 77053a9c..9b895a41 100644 --- a/features/distribution.feature +++ b/features/distribution.feature @@ -235,7 +235,7 @@ Feature: Fundraisers can distribute funds And the project balance should be "490.00" @javascript - Scenario: Send to an known email address who has no confirmation token + Scenario: Send to a known email address who has no confirmation token Given an user with email "bob@example.com" and without password nor confirmation token And a project managed by "alice" And our fee is "0" diff --git a/features/step_definitions/distribution.rb b/features/step_definitions/distribution.rb index 95b3a71e..449f37e1 100644 --- a/features/step_definitions/distribution.rb +++ b/features/step_definitions/distribution.rb @@ -25,6 +25,8 @@ find("input:enabled").set(arg1) click_on "Add" end + + wait_for_ajax end Given(/^I add the email address "(.*?)" to the recipients$/) do |arg1| @@ -41,6 +43,8 @@ find("input:enabled").set(user.identifier) click_on "Add" end + + wait_for_ajax end When(/^I select the commit recipients "(.*?)"$/) do |arg1| @@ -54,6 +58,8 @@ find("input:enabled").set(arg1) click_on "Add" end + + wait_for_ajax end Given(/^I fill the amount to "(.*?)" with "(.*?)"$/) do |arg1, arg2| diff --git a/features/support/ajax.rb b/features/support/ajax.rb new file mode 100644 index 00000000..6c9b4bb4 --- /dev/null +++ b/features/support/ajax.rb @@ -0,0 +1,2 @@ + +def wait_for_ajax ; sleep(1) ; end ;