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'
expect(page).to have_content error_message
expect(page).to have_content error_message("phone")
end
scenario 'Errors on verification code' do

View File

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