From 028376fe1ea7638f0119ba9614629f66453d206f Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 13 Nov 2017 13:16:41 +0100 Subject: fix: alternate email dialogue fixes #8796 Cleaned up UserController#update earlier but missed that it was used to change fallback email addresses. Now it is back. This time including an integration test. --- test/integration/browser/alternate_email_test.rb | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/integration/browser/alternate_email_test.rb (limited to 'test') diff --git a/test/integration/browser/alternate_email_test.rb b/test/integration/browser/alternate_email_test.rb new file mode 100644 index 0000000..fc58fb4 --- /dev/null +++ b/test/integration/browser/alternate_email_test.rb @@ -0,0 +1,25 @@ +require 'test_helper' + +class AlternateEmailTest < BrowserIntegrationTest + test "change alternate email" do + username, password = submit_signup + click_on 'Account Settings' + within(".edit_user") do + fill_in 'user_contact_email', with: 'test@leap.se' + click_on 'Save' + end + assert page.has_content?('Changes saved successfully') + assert_equal 'test@leap.se', + page.find('#user_contact_email').value + end + + test "change alternate email to invalid" do + username, password = submit_signup + click_on 'Account Settings' + within(".edit_user") do + fill_in 'user_contact_email', with: 'test@invalid' + click_on 'Save' + assert page.has_content?('is invalid') + end + end +end -- cgit v1.2.3