From 30fcb931e2d34e17108ed137231be3fdc7f80a14 Mon Sep 17 00:00:00 2001 From: Suyash Choudhary <57896905+sssash18@users.noreply.github.com> Date: Fri, 17 Jan 2020 22:28:29 +0530 Subject: [PATCH] Test for spamaway (#7276) * Added 'spamaway_textarea blank error' test * Added empty line between the test * Added 'do' --- test/integration/signup_flow_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/integration/signup_flow_test.rb b/test/integration/signup_flow_test.rb index eaa97b9e3b9..deaad82f78b 100644 --- a/test/integration/signup_flow_test.rb +++ b/test/integration/signup_flow_test.rb @@ -80,6 +80,26 @@ def setup assert response.body.include? 'errors prohibited this user from being saved' assert response.body.include? 'Email should look like an email address.' end + + test 'spamaway text area not blank error message' do + post '/register', params: { + user: { + username: "newuser", + email: @new_user[:email], + password: @new_user[:password], + password_confirmation: @new_user[:password] + }, + spamaway: { + statement1: @spamaway[:statement1], + statement2: @spamaway[:statement2], + statement3: @spamaway[:statement3], + statement4: @spamaway[:statement4], + follow_instructions: "Not_Blank" + } + } + assert response.body.include? '1 error prohibited this user from being saved' + assert response.body.include? 'Spam detection Please read the instructions in the last box carefully.' + end private