From 19e63f5cdcab248dd1223c96d3a003ef2784dc55 Mon Sep 17 00:00:00 2001 From: Prommah Date: Thu, 24 Sep 2015 07:15:49 +0100 Subject: [PATCH] Add test for nil SteamID --- spec/features/users/user_signs_up_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/features/users/user_signs_up_spec.rb b/spec/features/users/user_signs_up_spec.rb index 51de9ba..ff098f6 100755 --- a/spec/features/users/user_signs_up_spec.rb +++ b/spec/features/users/user_signs_up_spec.rb @@ -52,6 +52,15 @@ feature 'Visitor signs up', js: :true do expect(page).to have_content(error_message('steamid.invalid')) end + scenario 'with nil Steam ID' do + within registration_form do + fill_form(:user, user.slice(*sign_up_attributes).merge({ steamid: nil })) + click_button submit(:user, :create) + end + + expect(page).to have_content(error_message('steamid.invalid')) + end + def sign_up_attributes [:username, :email, :raw_password, :steamid] end