ContactCept.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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. $I->submitForm('#contact-form', array());
  7. $I->see('Contact', 'h1');
  8. $I->see('Name cannot be blank');
  9. $I->see('Email cannot be blank');
  10. $I->see('Subject cannot be blank');
  11. $I->see('Body cannot be blank');
  12. $I->see('The verification code is incorrect');
  13. $I->submitForm('#contact-form', array(
  14. 'ContactForm[name]' => 'tester',
  15. 'ContactForm[email]' => 'tester.email',
  16. 'ContactForm[subject]' => 'test subject',
  17. 'ContactForm[body]' => 'test content',
  18. 'ContactForm[verifyCode]' => 'testme',
  19. ));
  20. $I->dontSee('Name cannot be blank', '.help-inline');
  21. $I->see('Email is not a valid email address.');
  22. $I->dontSee('Subject cannot be blank', '.help-inline');
  23. $I->dontSee('Body cannot be blank', '.help-inline');
  24. $I->dontSee('The verification code is incorrect', '.help-inline');
  25. $I->submitForm('#contact-form', array(
  26. 'ContactForm[name]' => 'tester',
  27. 'ContactForm[email]' => 'tester@example.com',
  28. 'ContactForm[subject]' => 'test subject',
  29. 'ContactForm[body]' => 'test content',
  30. 'ContactForm[verifyCode]' => 'testme',
  31. ));
  32. $I->dontSeeElement('#contact-form');
  33. $I->see('Thank you for contacting us. We will respond to you as soon as possible.');