makes specs for error handling more robust

This commit is contained in:
rgarcia
2016-02-05 13:08:09 +01:00
parent a5f7211d82
commit d2400d0b36
2 changed files with 4 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ feature 'SMS Verification' do
click_button 'Send' click_button 'Send'
expect(page).to have_content error_message expect(page).to have_content error_message("phone")
end end
scenario 'Errors on verification code' do scenario 'Errors on verification code' do

View File

@@ -108,8 +108,9 @@ module CommonActions
SCRIPT SCRIPT
end end
def error_message def error_message(resource_model=nil)
/\d errors? prevented this (.*) from being saved:/ resource_model ||= "(.*)"
/\d errors? prevented this #{resource_model} from being saved:/
end end
def expect_to_be_signed_in def expect_to_be_signed_in