|
| 1 | +<?php |
| 2 | +$I = new WebGuy($scenario); |
| 3 | +$I->wantTo('ensure that contact works'); |
| 4 | +$I->amOnPage('?r=site/contact'); |
| 5 | +$I->see('Contact', 'h1'); |
| 6 | + |
| 7 | +$I->submitForm('#contact-form', array()); |
| 8 | +$I->see('Contact', 'h1'); |
| 9 | +$I->see('Name cannot be blank'); |
| 10 | +$I->see('Email cannot be blank'); |
| 11 | +$I->see('Subject cannot be blank'); |
| 12 | +$I->see('Body cannot be blank'); |
| 13 | +$I->see('The verification code is incorrect'); |
| 14 | + |
| 15 | +$I->submitForm('#contact-form', array( |
| 16 | + 'ContactForm[name]' => 'tester', |
| 17 | + 'ContactForm[email]' => 'tester.email', |
| 18 | + 'ContactForm[subject]' => 'test subject', |
| 19 | + 'ContactForm[body]' => 'test content', |
| 20 | + 'ContactForm[verifyCode]' => 'testme', |
| 21 | +)); |
| 22 | +$I->dontSee('Name cannot be blank', '.help-inline'); |
| 23 | +$I->see('Email is not a valid email address.'); |
| 24 | +$I->dontSee('Subject cannot be blank', '.help-inline'); |
| 25 | +$I->dontSee('Body cannot be blank', '.help-inline'); |
| 26 | +$I->dontSee('The verification code is incorrect', '.help-inline'); |
| 27 | + |
| 28 | +$I->submitForm('#contact-form', array( |
| 29 | + 'ContactForm[name]' => 'tester', |
| 30 | + 'ContactForm[email]' => '[email protected]', |
| 31 | + 'ContactForm[subject]' => 'test subject', |
| 32 | + 'ContactForm[body]' => 'test content', |
| 33 | + 'ContactForm[verifyCode]' => 'testme', |
| 34 | +)); |
| 35 | +$I->dontSeeElement('#contact-form'); |
| 36 | +$I->see('Thank you for contacting us. We will respond to you as soon as possible.'); |
0 commit comments