Skip to content

Instantly share code, notes, and snippets.

@odino
Created July 18, 2010 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odino/480354 to your computer and use it in GitHub Desktop.
Save odino/480354 to your computer and use it in GitHub Desktop.
click('Save', array('qredd_content' => array(
'content_type_id' => 1,
'title' => 'Content sample',
'aggregator_id' => '0',
'is_active' => true,
)))->
with('request')->begin()->
isParameter('module', 'content')->
isParameter('action', 'create')->
end()->
with('form')->begin()->info('form is good')->
hasErrors(false)->
end()->
with('response')->isRedirected()->
followRedirect()->
with('request')->begin()->info('admin can edit the just inserted content')->
isParameter('module', 'content')->
isParameter('action', 'edit')->
end()->info('now admin can fill the form elements for the content type, but he forgives to fill the required ones')->
click('Save', array('qredd_content' => array(
'content_type_id' => 1,
'title' => 'Content sample',
'aggregator_id' => '0',
'is_active' => true,
)))->
with('request')->begin()->
isParameter('module', 'content')->
isParameter('action', 'update')->
end()->
with('form')->begin()->info('form is good')->
hasErrors(true)->
isError('Sample link', 'value [required]')->
isError('Sample text', 'value [required]')->
isError('Sample textarea', 'value [required]')->
isError('Sample fancytextarea', 'value [required]')->
isError('Sample checkbox', 'value [required]')->
isError('Sample tweet', 'value [required]')->
end()->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment