- I18n.available_locales.each do |locale|
- dup_email = create(:user).email
- display_name = "#{locale}_new_tester"
- assert_difference("User.count", 0) do
- assert_difference("ActionMailer::Base.deliveries.size", 0) do
+ dup_email = create(:user).email
+ display_name = "new_tester"
+ assert_difference("User.count", 0) do
+ assert_difference("ActionMailer::Base.deliveries.size", 0) do
+ perform_enqueued_jobs do
+ post "/user/new",
+ :params => { :user => { :email => dup_email,
+ :display_name => display_name,
+ :pass_crypt => "testtest",
+ :pass_crypt_confirmation => "testtest",
+ :consider_pd => "1" } }
+ end
+ end
+ end
+ assert_response :success
+ assert_template "users/new"
+ assert_select "form"
+ assert_select "form > div > input.is-invalid#user_email"
+ end
+
+ def test_user_create_association_submit_duplicate_email
+ dup_email = create(:user).email
+ display_name = "new_tester"
+ assert_difference("User.count", 0) do
+ assert_no_difference("ActionMailer::Base.deliveries.size") do
+ perform_enqueued_jobs do