Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gh-pages' of git@github.com:nando/mundo-pepino
- Loading branch information
Showing
6 changed files
with
263 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | ||
<title>ConfRails2009: Testing sin tests... - Step Uno</title> | ||
</head> | ||
<body> | ||
<div id="content" class="site"> | ||
|
||
|
||
<div class="wikistyle"> | ||
|
||
<h1>Testing sin escribir tests con Cucumber y MundoPepino</h1> | ||
<h2>Step Uno: Preparación del entorno con Introducción simpática</h2> | ||
|
||
<h3>http://nando.github.com/mundo-pepino/</h3> | ||
|
||
<pre><code> | ||
sudo gem install mundo-pepino rack --no-ri --no-rdoc #we need rack 1.0.1 for rails 2.3.5 | ||
rails everybody_votes | ||
cd everybody_votes | ||
script/generate cucumber | ||
</code></pre> | ||
<a href="pages/step-dos.html">Siguiente paso</a> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | ||
<title>ConfRails2009: Testing sin tests... - Step Cinco</title> | ||
</head> | ||
<body> | ||
<div id="content" class="site"> | ||
|
||
|
||
<div class="wikistyle"> | ||
|
||
<h1>Testing sin escribir tests con Cucumber y MundoPepino</h1> | ||
<h2>Step Cinco: Ciudadano Ejerciendo su derecho a Votar!</h2> | ||
|
||
<pre><code> | ||
git clone git://github.com/voodoorai2000/Everybody-votes.git | ||
</code></pre> | ||
|
||
<pre><code> | ||
Caracteristica: Votar | ||
|
||
Para que mi opinion se tenga en cuenta en las decisiones del parlamento | ||
Como ciudadan@ | ||
Quiero poder votar | ||
|
||
Antecedentes: | ||
Dado que tenemos una propuesta "Ruby en la Administración" | ||
Y que tenemos una ciudadana llamada "Ana" | ||
|
||
Escenario: Votar | ||
Cuando me logeo como "Ana" | ||
Y voy a la pagina de dicha propuesta | ||
Y hago click en el boton "SI" | ||
|
||
Entonces veo el texto "Has votado SI a la propuesta 'Ruby en la Administración'" | ||
Y la propuesta "Ruby en la Administración" tiene en bbdd un voto "SI" | ||
Y la ciudadana "Ana" tiene en bbdd un voto "SI" | ||
</code></pre> | ||
|
||
<a href="step-seis.html">Siguiente paso</a> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | ||
<title>ConfRails2009: Testing sin tests... - Step Cuatro</title> | ||
</head> | ||
<body> | ||
<div id="content" class="site"> | ||
|
||
|
||
<div class="wikistyle"> | ||
|
||
<h1>Testing sin escribir tests con Cucumber y MundoPepino</h1> | ||
<h2>Step Cuatro: Introducing MundoPepino </h2> | ||
<p> | ||
Vamos a ver si MundoPepino es capaz de entender nuestra feature de la portada. Para ello comentamos el código de las definiciones de nuestros steps. | ||
</p> | ||
<p> | ||
Para ello lanzamos: | ||
</p> | ||
<pre><code> | ||
script/generate mundo_pepino_steps | ||
rake db:migrate | ||
rake caracteristicas | ||
</code></pre> | ||
|
||
<p>Convenciones más importantes del MundoPepino:</p> | ||
<ul> | ||
<li>Primera persona del singular para todo lo que puedo hacer como un usuario (nos ponemos en su piel) | ||
</li> | ||
<li>Primera persona del plural para todo lo que no puedo hacer como un usuario (p.e. creación y recuperación atacando directamente a la base de datos). | ||
</li> | ||
<li>Se utiliza el campo "name" para crear y buscar recursos en la base de datos. | ||
</li> | ||
<li>Las comillas (dobles o simples) son opcionales salvo para expresar un valor (p.e. Dado que tenemos un usuario "Pepe") | ||
</li> | ||
<li>"Dado que" para lidiar con género y número (Dados, Dada, Dada) sin tener que tocar las palabras reservadas que trae Cucumber. | ||
</li> | ||
</ul> | ||
|
||
<a href="step-cinco.html">Siguiente paso</a> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | ||
<title>ConfRails2009: Testing sin tests... - Step Dos</title> | ||
</head> | ||
<body> | ||
<div id="main"> | ||
|
||
<div id="content" class="site"> | ||
|
||
|
||
<div class="wikistyle"> | ||
|
||
<h1>Testing sin escribir tests con Cucumber y MundoPepino</h1> | ||
<h2>Step Dos: Portada de Everybody Votes</h2> | ||
|
||
<p> | ||
Tenemos que escribir una feature que compruebe que aparece el texto "Everybody Votes" en la home de la aplicación. | ||
</p> | ||
|
||
<p> | ||
Creamos un fichero con la extension .feature en el directorio features con la siguiente plantilla: | ||
</p> | ||
<pre><code> | ||
Característica: Portada de Everybody Votes | ||
Escenario: Nombre de la aplicación en la portada | ||
Cuando [rellena este hueco] | ||
Entonces [rellena este hueco] | ||
</code></pre> | ||
|
||
<p> | ||
Una vez rellenados los huecos de la plantilla, comenzamos el flow: | ||
</p> | ||
<ol> | ||
<li>One: | ||
<pre><code> | ||
cucumber features --language es | ||
</code></pre> | ||
</li> | ||
|
||
<li>Two: | ||
Como todavía no hemos implementado nada Cucumber nos ofrece unos snippets para definir nuestros steps. Crear un fichero nuevo con extensión .rb en el directorio features/step_definitions y copiar en él el primer snippet. | ||
</li> | ||
|
||
<li>Tres: | ||
La implementación de dicho paso la encrontraréis dentro de su equivalente en inglés dentro del fichero features/step_definitions/webrat_steps.rb. | ||
</li> | ||
<li>Cuatro: | ||
Implementar el código necesario para que pase el step. | ||
</li> | ||
<li>Cinco: | ||
Repetir el flow hasta que todo sea verde. | ||
</li> | ||
</ol> | ||
<a href="step-tres.html">Siguiente paso</a> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | ||
<title>ConfRails2009: Testing sin tests... - Step Seis</title> | ||
</head> | ||
<body> | ||
<div id="content" class="site"> | ||
|
||
|
||
<div class="wikistyle"> | ||
|
||
<h1>Testing sin escribir tests con Cucumber y MundoPepino</h1> | ||
<h2>Step Seis: Ciudadano Delega su voto</h2> | ||
|
||
<pre><code> | ||
git clone git://github.com/voodoorai2000/everybody-delegates.git | ||
</code></pre> | ||
|
||
<pre><code> | ||
Caracteristica: Delegar | ||
|
||
Para que alguien en quien confio vote por mi | ||
Como ciudadan@ | ||
Quiero poder delegar mi voto | ||
|
||
Escenario: | ||
Dado que tenemos 2 ciudadanos "Jose y Ana" | ||
Y me logeo como "Ana" | ||
Y visito el listado de ciudadanos | ||
Y hago click en el enlace "Jose" | ||
Cuando hago click en el boton "Delegar" | ||
|
||
Entonces veo el texto "Jose es tu nuevo portavoz" | ||
Y la ciudadana "Ana" tiene en bbdd como portavoz "Jose" | ||
</code></pre> | ||
|
||
</body> | ||
</html> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | ||
<title>ConfRails2009: Testing sin tests... - Step Tres</title> | ||
</head> | ||
<body> | ||
<div id="content" class="site"> | ||
|
||
|
||
<div class="wikistyle"> | ||
|
||
<h1>Testing sin escribir tests con Cucumber y MundoPepino</h1> | ||
<h2>Step Tres: Ciudadanos en La Home </h2> | ||
|
||
Ahora de lo que se trata es de comprobar que los ciudadanos aparecen en La Home. | ||
|
||
Añadimos un nuevo escenario en la feature de la portada que cree las instancias de los ciudadanos, visite la portada y compruebe que sus nombres aparecen en ella. | ||
<pre><code> | ||
Escenario: Nombre de los ciudadanos en la portada | ||
Dado [rellena este huevo] | ||
Cuando [rellena este hueco] | ||
Entonces [rellena este hueco] | ||
</code></pre> | ||
|
||
<p> | ||
Una vez rellenados los huecos de la plantilla, comenzamos el flow: | ||
</p> | ||
<pre><code> | ||
cucumber features --language es | ||
</code></pre> | ||
<p> | ||
Pillamos los snippets y ya sabéis lo que toca: verde. | ||
</p> | ||
<a href="step-cuatro.html">Siguiente paso</a> | ||
</body> | ||
</html> |