From fefe5a12bafed81535daaeab02b222ec5fc5e392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Sat, 8 Aug 2015 14:04:55 +0200 Subject: [PATCH] adds spec for failed edition of user data --- spec/features/account_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/features/account_spec.rb b/spec/features/account_spec.rb index e622c83c1..174145a7f 100644 --- a/spec/features/account_spec.rb +++ b/spec/features/account_spec.rb @@ -15,6 +15,20 @@ feature 'Account' do expect(page).to have_selector("input[value='Colau']") end + scenario "Failed Edit" do + login_as(@user) + visit account_path + + fill_in 'account_first_name', with: '' + fill_in 'account_last_name', with: '' + fill_in 'account_nickname', with: '' + click_button 'Save changes' + + expect(page).to have_content "2 errors prohibited this debate from being saved" + expect(page).to have_content "First name can't be blank" + expect(page).to have_content "First name can't be blank" + end + scenario 'Edit' do login_as(@user) visit account_path