Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated the chapters structure.

  • Loading branch information...
commit e1363dc98b226cf65da395ef5407009990b7e9f4 1 parent 29e3350
@mr-rock mr-rock authored committed
Showing with 518 additions and 1 deletion.
  1. +5 −0 book-content/es/10-recipes/toc.markdown
  2. +9 −0 book-content/es/11-deployment/toc.markdown
  3. 0  book-content/es/{6-recipes → 12-recipes}/1-simple-blog.markdown
  4. 0  book-content/es/{6-recipes → 12-recipes}/2-blog-slice.markdown
  5. 0  book-content/es/{6-recipes → 12-recipes}/toc.markdown
  6. +7 −0 book-content/es/13-appendix/toc.markdown
  7. 0  book-content/es/{7-deployment → 14-deployment}/1-passenger.markdown
  8. 0  book-content/es/{7-deployment → 14-deployment}/2-nginx.markdown
  9. 0  book-content/es/{7-deployment → 14-deployment}/3-jruby.markdown
  10. 0  book-content/es/{7-deployment → 14-deployment}/4-bundle.markdown
  11. 0  book-content/es/{7-deployment → 14-deployment}/toc.markdown
  12. +4 −0 book-content/es/15-migration-to-rails3/1-merb-and-rails-merge.markdown
  13. +5 −0 book-content/es/15-migration-to-rails3/toc.markdown
  14. 0  book-content/es/{8-appendix → 16-appendix}/1-hints-tips.markdown
  15. 0  book-content/es/{8-appendix → 16-appendix}/2-slices.markdown
  16. 0  book-content/es/{8-appendix → 16-appendix}/3-gems.markdown
  17. 0  book-content/es/{8-appendix → 16-appendix}/toc.markdown
  18. +4 −0 book-content/es/4-interacting-with-the-database-active_record/1-setting-up.markdown
  19. +4 −0 book-content/es/4-interacting-with-the-database-active_record/2-queries.markdown
  20. +6 −0 book-content/es/4-interacting-with-the-database-active_record/toc.markdown
  21. +26 −0 book-content/es/5-interacting-with-the-database-sequel/1-setting-up.markdown
  22. +53 −0 book-content/es/5-interacting-with-the-database-sequel/2-database-migrations.markdown
  23. +65 −0 book-content/es/5-interacting-with-the-database-sequel/3-data-retrieval-and-manipulation.markdown
  24. +40 −0 book-content/es/5-interacting-with-the-database-sequel/4-model-associations.markdown
  25. +55 −0 book-content/es/5-interacting-with-the-database-sequel/5-model-validation.markdown
  26. +87 −0 book-content/es/5-interacting-with-the-database-sequel/6-sequel-plugins.markdown
  27. +11 −0 book-content/es/5-interacting-with-the-database-sequel/toc.markdown
  28. +11 −0 book-content/es/6-merb-more/toc.markdown
  29. +1 −1  book-content/es/{4-testing-your-application → 7-testing-your-application}/1-why.markdown
  30. 0  book-content/es/{4-testing-your-application → 7-testing-your-application}/2-models.markdown
  31. 0  book-content/es/{4-testing-your-application → 7-testing-your-application}/3-requests.markdown
  32. 0  book-content/es/{4-testing-your-application → 7-testing-your-application}/4-cucumber.markdown
  33. 0  book-content/es/{4-testing-your-application → 7-testing-your-application}/toc.markdown
  34. +22 −0 book-content/es/8-testing-your-application/1-why.markdown
  35. +1 −0  book-content/es/8-testing-your-application/2-models.markdown
  36. +1 −0  book-content/es/8-testing-your-application/3-requests.markdown
  37. +92 −0 book-content/es/8-testing-your-application/4-cucumber.markdown
  38. +9 −0 book-content/es/8-testing-your-application/toc.markdown
  39. 0  book-content/es/{5-merb-more → 9-merb-more}/1-authentication.markdown
  40. 0  book-content/es/{5-merb-more → 9-merb-more}/2-mailer.markdown
  41. 0  book-content/es/{5-merb-more → 9-merb-more}/3-caching.markdown
  42. 0  book-content/es/{5-merb-more → 9-merb-more}/4-exceptions.markdown
  43. 0  book-content/es/{5-merb-more → 9-merb-more}/5-slices.markdown
  44. 0  book-content/es/{5-merb-more → 9-merb-more}/toc.markdown
View
5 book-content/es/10-recipes/toc.markdown
@@ -0,0 +1,5 @@
+# recipes
+
+ <ul class='toc'><li><a href='/en/recipes/blog'>Simple blog</a></li></ul>
+
+<ul class='toc'><li><a href='/en/recipes/slice'>Blog Slice</a></li></ul>
View
9 book-content/es/11-deployment/toc.markdown
@@ -0,0 +1,9 @@
+# deployment
+
+ <ul class='toc'><li><a href='/en/deployment/passenger'>Passenger</a><ul style='list-style: none;'><li><a href='/en/deployment/passenger#installing_ruby_enterprise_edition_ree'>Installing Ruby Enterprise Edition (REE)</a><ul style='list-style: none;'><li><a href='/en/deployment/passenger#download_ree'>Download REE</a></li><li><a href='/en/deployment/passenger#install'>Install</a></li></ul></li><li><a href='/en/deployment/passenger#installing_passenger'>Installing Passenger</a></li><li><a href='/en/deployment/passenger#configuration'>Configuration</a><ul style='list-style: none;'><li><a href='/en/deployment/passenger#configru'>config.ru</a></li></ul></li><li><a href='/en/deployment/passenger#capistrano_task'>Capistrano Task</a></li></ul></li></ul>
+
+<ul class='toc'><li><a href='/en/deployment/nginx'>Nginx</a><ul style='list-style: none;'><li><a href='/en/deployment/nginx#installation'>Installation</a><ul style='list-style: none;'><li><a href='/en/deployment/nginx#mac_os_x_requires_macports'>Mac OS X (requires <a href='http://macports.org/'>MacPorts</a>)</a></li><li><a href='/en/deployment/nginx#debian__ubuntu_linux'>Debian / Ubuntu Linux</a></li><li><a href='/en/deployment/nginx#gentoo_linux'>Gentoo Linux</a></li></ul></li><li><a href='/en/deployment/nginx#configuration'>Configuration</a><ul style='list-style: none;'><li><a href='/en/deployment/nginx#etcnginxnginxconf'>/etc/nginx/nginx.conf</a></li></ul></li><li><a href='/en/deployment/nginx#capistrano_task'>Capistrano Task</a></li><li><a href='/en/deployment/nginx#monit'>Monit</a></li></ul></li></ul>
+
+<ul class='toc'><li><a href='/en/deployment/jruby'>JRuby and Glassfish</a></li></ul>
+
+<ul class='toc'><li><a href='/en/deployment/bundle'>Bundling your Merb application</a><ul style='list-style: none;'><li><a href='/en/deployment/bundle#why_bundling'>Why bundling</a></li><li><a href='/en/deployment/bundle#how_to_bundle'>How to bundle</a></li></ul></li></ul>
View
0  ...ntent/es/6-recipes/1-simple-blog.markdown → ...tent/es/12-recipes/1-simple-blog.markdown
File renamed without changes
View
0  ...ontent/es/6-recipes/2-blog-slice.markdown → ...ntent/es/12-recipes/2-blog-slice.markdown
File renamed without changes
View
0  book-content/es/6-recipes/toc.markdown → book-content/es/12-recipes/toc.markdown
File renamed without changes
View
7 book-content/es/13-appendix/toc.markdown
@@ -0,0 +1,7 @@
+# appendix
+
+ <ul class='toc'><li><a href='/en/appendix/tips'>Hints and Tips</a></li></ul>
+
+<ul class='toc'><li><a href='/en/appendix/slices'>Available Slices</a></li></ul>
+
+<ul class='toc'><li><a href='/en/appendix/gems'>Useful Gems</a></li></ul>
View
0  ...tent/es/7-deployment/1-passenger.markdown → ...ent/es/14-deployment/1-passenger.markdown
File renamed without changes
View
0  ...-content/es/7-deployment/2-nginx.markdown → ...content/es/14-deployment/2-nginx.markdown
File renamed without changes
View
0  ...-content/es/7-deployment/3-jruby.markdown → ...content/es/14-deployment/3-jruby.markdown
File renamed without changes
View
0  ...content/es/7-deployment/4-bundle.markdown → ...ontent/es/14-deployment/4-bundle.markdown
File renamed without changes
View
0  book-content/es/7-deployment/toc.markdown → book-content/es/14-deployment/toc.markdown
File renamed without changes
View
4 book-content/es/15-migration-to-rails3/1-merb-and-rails-merge.markdown
@@ -0,0 +1,4 @@
+# La fusión entre Merb y Rails
+
+* Esto será una tabla de contenidos (este texto será pegado).
+{:toc}
View
5 book-content/es/15-migration-to-rails3/toc.markdown
@@ -0,0 +1,5 @@
+# migration-to-rails3
+
+<ul class='toc'>
+ <li><a href='/es/migration-to-rails3/merge'>La fusión entre Merb y Rails</a></li>
+</ul>
View
0  ...ntent/es/8-appendix/1-hints-tips.markdown → ...tent/es/16-appendix/1-hints-tips.markdown
File renamed without changes
View
0  book-content/es/8-appendix/2-slices.markdown → ...-content/es/16-appendix/2-slices.markdown
File renamed without changes
View
0  book-content/es/8-appendix/3-gems.markdown → book-content/es/16-appendix/3-gems.markdown
File renamed without changes
View
0  book-content/es/8-appendix/toc.markdown → book-content/es/16-appendix/toc.markdown
File renamed without changes
View
4 book-content/es/4-interacting-with-the-database-active_record/1-setting-up.markdown
@@ -0,0 +1,4 @@
+# Configurando Active Record
+
+* Esto será una tabla de contenidos (este texto será pegado).
+{:toc}
View
4 book-content/es/4-interacting-with-the-database-active_record/2-queries.markdown
@@ -0,0 +1,4 @@
+# Consultas a la base de datos con Active Record
+
+* Esto será una tabla de contenidos (este texto será pegado).
+{:toc}
View
6 book-content/es/4-interacting-with-the-database-active_record/toc.markdown
@@ -0,0 +1,6 @@
+# Interactuando con la base de datos utilizando Active Record
+
+<ul class='toc'>
+ <li><a href='/es/4-interacting-with-the-database-active_record/up'>Configurando Active Record</a></li>
+ <li><a href='/es/4-interacting-with-the-database-active_record/queries'>Consultas a la base de datos</a></li>
+</ul>
View
26 book-content/es/5-interacting-with-the-database-sequel/1-setting-up.markdown
@@ -0,0 +1,26 @@
+# Instalacion y configuracion
+
+## Generando un proyecto utilizando Sequel
+A fin de crear una aplicacion Merb utilizando Sequel,
+To create a core app with Sequel, merb-gen takes a `--orm` flag.
+
+ $ merb-gen core --orm sequel new_app
+
+This will build the desired application, but falls a little short when it comes to bells and whistles.
+
+To achieve results similar to merb-gen app, the merb-sequel-stack gem can be used.
+
+ $ git clone git://github.com/jackdempsey/merb-sequel-stack.git
+ $ cd merb-sequel-stack/
+ $ rake install
+
+merb-gen will now include a sequel-app generator.
+This will generate an app that uses Sequel, rspec, and the rest of what can be expected from `merb-gen app`.
+
+ $merb-gen sequel-app new_app
+
+By default, `merb-gen sequel-app` will generate a database.yml file that uses sqlite3.
+For more info, check out the [repository][].
+
+
+[repository]: http://github.com/jackdempsey/merb-sequel-stack/tree
View
53 book-content/es/5-interacting-with-the-database-sequel/2-database-migrations.markdown
@@ -0,0 +1,53 @@
+#Database Migrations
+
+Sequel migrations will be generated with any merb-gen task that creates a model.
+
+ $ merb-gen model post
+ Generating with model generator:
+ [ADDED] spec/models/post_spec.rb
+ [ADDED] app/models/post.rb
+ [ADDED] schema/migrations/001_post_migration.rb
+
+ $ cat schema/migrations/001_post_migration.rb
+
+ # For details on Sequel migrations see
+ # http://sequel.rubyforge.org/
+
+ class PostMigration < Sequel::Migration
+
+ def up
+ create_table :posts do
+ primary_key :id
+ end
+ end
+
+ def down
+ drop_table :posts
+ end
+
+ end
+
+Columns can be added to the table definition using the `#column` method or the column type can be used as the method in the specification.
+
+ class PostMigration < Sequel::Migration
+
+ def up
+ create_table :posts do
+ primary_key :id
+ string :title
+ text :body
+ boolean :published, :default => false
+ end
+ end
+
+ def down
+ drop_table :posts
+ end
+
+ end
+
+After editing the migration, it can be run with a rake task.
+
+ $ rake sequel:db:migrate
+
+A VERSION flag can be specified to roll back to particular migration versions.
View
65 ...tent/es/5-interacting-with-the-database-sequel/3-data-retrieval-and-manipulation.markdown
@@ -0,0 +1,65 @@
+#Database Retreival and Manipulation
+
+##Finding records
+
+Square brackets will return a single object.
+A primary key can be passed in as parameter, or a hash, which is used as a set of conditions.
+
+ $ merb -i
+ >> Post[1]
+ => #<Post @values={:published=>false, :body=>"This is a blog post", :id=>1, :title=>"First Post"}>
+
+ >> Post[:title => 'First Post']
+ => #<Post @values={:published=>false, :body=>"This is a blog post", :id=>1, :title=>"First Post"}>
+
+`Post.all` will return the entire set of Post objects.
+The Sequel model is treated like a Sequel dataset.
+All of the selection and refinement methods available to a dataset can be applied to a Sequel::Model.
+To simplify the following examples, the SQL statements produced by Sequel::Model have been shown.
+
+ $ merb -i
+ >> Post.all
+ ~ SELECT * FROM `posts`
+
+ >> Post.filter(:published => true).all
+ ~ SELECT * FROM `posts` WHERE (`published` = 't')
+
+ >> Post.exclude(:published => true).all
+ ~ SELECT * FROM `posts` WHERE (`published` != 't')
+
+ >> Post.order(:created_at.desc).paginate(2, 10).all
+ ~ SELECT * FROM `posts` ORDER BY `created_at` DESC LIMIT 10 OFFSET 10
+
+##The Other Three Letters in CRUD
+
+###Create
+
+ >> p = Post.create(:title => 'second post', :body => 'another post for something')
+ => #<Post @values={:published=>false, :body=>"another post for something", :id=>2, :title=>"second post"}>
+ >> p.new?
+ => false
+
+###Update
+
+ >> p = Post[2]
+ => #<Post @values={:published=>false, :body=>"another post for something", :id=>2, :title=>"second post"}>
+ >> p.update(:title => 'replacement title')
+ => #<Post @values={:published=>false, :body=>"another post for something", :id=>2, :title=>"replacement title"}>
+
+###Delete
+
+ >> p = Post[2]
+ => p.destroy
+ >> p.exists?
+ => false
+
+Mass deletions are also available.
+
+ # This will run destruction hooks on each object
+ Post.filter(:user_id => 3).destroy
+
+ # This is faster, but will not run hooks.
+ # It just runs a single query.
+ Post.filter(:user_id => 3).delete
+
+A simple way to see Sequel CRUD in action is to merb-gen a resource and view the generated controller.
View
40 book-content/es/5-interacting-with-the-database-sequel/4-model-associations.markdown
@@ -0,0 +1,40 @@
+#Model Associations
+
+`Sequel::Model` has a very simple set of association methods.
+Sequel provides `many_to_one`, `one_to_many` and `many_to_many` to create database associations.
+
+
+##One to Many
+
+ class Post < Sequel::Model
+ one_to_many :comments
+ end
+{:lang=ruby html_use_syntax=true}
+
+
+
+The Post class above now has a set of association methods similar to ActiveRecord's has\_many.
+
+##Many to One
+
+ class Post < Sequel::Model
+ many_to_one :user
+ end
+{:lang=ruby html_use_syntax=true}
+
+##Many to Many
+
+ class Post < Sequel::Model
+ many_to_many :tags
+ end
+{:lang=ruby html_use_syntax=true}
+
+## One to One
+
+ class User < Sequel::Model
+ one_to_many :addresses, :one_to_one => true
+ end
+{:lang=ruby html_use_syntax=true}
+
+
+
View
55 book-content/es/5-interacting-with-the-database-sequel/5-model-validation.markdown
@@ -0,0 +1,55 @@
+#Model Validation
+
+`Sequel::Model` provides a set of validation methods by default.
+The available standard validations are:
+
+ - acceptance\_of
+ - confirmation\_of
+ - format\_of
+ - length\_of
+ - numericality\_of
+ - presence\_of
+ - uniqueness\_of
+
+Validations can be specified in two ways within a class.
+
+ class User < Sequel::Model
+
+ validates_confirmation_of :password
+ validates_length_of :login, :minimum => 5
+
+ # or
+
+ validates do
+ confirmation_of :password
+ length_of :login, :minimum => 5
+ end
+ end
+{:lang=ruby html_use_syntax=true}
+
+
+
+By default, Sequel::Model will raise an error on validation failures.
+The class accessor `:raise_on_save_failure` can be set to false to avoid raising errors on validation failure.
+If `raise_on_save_failure` is false, the `#save` method will return false on failures
+
+An important distinction between Sequel::Model and ActiveRecord is the `#save!` method.
+In Sequel::Model, `#save!` will update the record without validation.
+This is significantly different from ActiveRecord, which will run validations and raise an error on failure.
+
+If validation fails, errors can be accessed on the object with the `#errors` method.
+
+ User.raise_on_save_faliure = false
+ u = User.new(:login => 3)
+
+ u.save
+ => false
+ u.errors.on(:login)
+ => 'is too short'
+{:lang=ruby html_use_syntax=true}
+
+
+A full set of documentation for model validations can be found in the [Merb::Sequel documentation][]
+
+
+[Merb::Sequel documentation]: http://sequel.rubyforge.org/rdoc/classes/Sequel/Model.html
View
87 book-content/es/5-interacting-with-the-database-sequel/6-sequel-plugins.markdown
@@ -0,0 +1,87 @@
+#Sequel Plugins
+
+Sequel::Model may seem like the minimal set of functionality for an ORM, but it is easy to extend its capabilities.
+Sequel Plugins are libraries packaged as gems which can add useful functionality to your models.
+Plugins are named like `sequel_pluginname`.
+They're used in models by declaring `is :pluginname`.
+Plugins for Sequel are painless to use, and are easy to write.
+
+
+##Useful Plugins
+
+###sequel\_timestamped
+
+As the name would indicate, sequel\_timestamped will update standard timestamp columns in your model.
+
+ class Note < Sequel::Model
+ is :timestamped
+ end
+
+If the model has `created_at` and `updated_at` timestamp columns, they will be updated as expected.
+
+Here's the [sequel\_timestamped source][].
+
+###sequel\_notnaughty
+
+The sequel\_notnaughty plugin replaces standard Sequel::Model validation with not-naughty validation.
+Not-naughty is a gem that provides an easily extensible validation framework.
+
+ class User < Sequel::Model
+ is :notnaughty
+
+ #now use the not-naughty syntax for validation
+ validates do
+ presence_of :login
+ length_of :login, :minimum => 5
+ end
+ end
+
+Here's the [sequel\_notnaughty source][], and the [not-naughty source][].
+
+
+###sequel\_polymorphic
+
+Sequel\_polymorphic takes the hard work of setting up polymorphic relationships out of your hands.
+The plugin adds functionality to Sequel's associations to handle these situations.
+
+ class Note < Sequel::Model
+ is :polymorphic
+ one_to_many :assets, :as => :attachable
+ end
+
+ class Asset < Sequel::Model
+ is :polymorphic
+ many_to_one :attachable, :polymorphic => true
+ end
+
+This will create a transparent polymorphic relationship between the Note and its Assets.
+
+Here's the [sequel\_polymorphic source][].
+
+###sequel\_taggable
+
+Sequel taggable is another plugin developed by Jack Dempsey while working with Merb.
+It just adds simple tagging methods to a model.
+As of right now, there are no tasks with the plugin to generate a Tag table.
+There is, however, a migration included in the plugin source.
+
+ class Article < Sequel::Model
+ is :taggable
+ end
+
+ a = Article.create(:title => "My first article")
+ t = Tag.create(:name => "a tag")
+ a.add_tag(t)
+
+Sequel\_taggable depends on the sequel\_polymophic plugin.
+Here's the [sequel\_taggable source][].
+
+[sequel_timestamped source]: http://github.com/bricooke/sequel_timestamped/tree/master
+
+[sequel_notnaughty source]: http://github.com/boof/sequel_notnaughty/tree/master
+
+[not-naughty source]: http://github.com/boof/not-naughty/tree/master
+
+[sequel_polymorphic source]: http://github.com/jackdempsey/sequel_polymorphic/tree/master
+
+[sequel_taggable source]: http://github.com/jackdempsey/sequel_taggable/tree/master
View
11 book-content/es/5-interacting-with-the-database-sequel/toc.markdown
@@ -0,0 +1,11 @@
+# Interactuando con la base de datos utilizando Sequel
+
+<ul class='toc'>
+ <li><a href='/es/interacting-with-the-database-sequel/setting-up'>Instalacion y configuracion</a></li>
+ <li><a href='/es/interacting-with-the-database-sequel/migrations'>Migraciones hacia la base de datos</a></li>
+ <li><a href='/es/interacting-with-the-database-sequel/data-retrieval-and-manipulation'>Obtencion y manipulacion de datos</a></li>
+ <li><a href='/es/interacting-with-the-database-sequel/model-associations'>Asociaciones entre modelos</a></li>
+ <li><a href='/es/interacting-with-the-database-sequel/model-validation'>Validaciones de los modelos</a></li>
+ <li><a href='/es/interacting-with-the-database-sequel/sequel-plugins'>Plug-ins de Sequel</a></li>
+</ul>
+
View
11 book-content/es/6-merb-more/toc.markdown
@@ -0,0 +1,11 @@
+# merb-more
+
+ <ul class='toc'><li><a href='/en/merb-more/authentication'>Authentication</a><ul style='list-style: none;'><li><a href='/en/merb-more/authentication#merbauth_gems'>Merb-auth gems</a><ul style='list-style: none;'><li><a href='/en/merb-more/authentication#merbauthcore'>merb-auth-core</a></li><li><a href='/en/merb-more/authentication#merbauthmore'>merb-auth-more</a></li><li><a href='/en/merb-more/authentication#merbauthslicepassword'>merb-auth-slice-password</a></li></ul></li><li><a href='/en/merb-more/authentication#authentication_in_merb_stack'>Authentication in Merb Stack</a></li><li><a href='/en/merb-more/authentication#authenticated_hello_world'>Authenticated Hello World</a><ul style='list-style: none;'><li><a href='/en/merb-more/authentication#generate_an_application'>Generate an application</a></li><li><a href='/en/merb-more/authentication#generate_something_to_protect'>Generate something to protect</a></li><li><a href='/en/merb-more/authentication#protect_the_route'>Protect the route</a></li><li><a href='/en/merb-more/authentication#protect_the_controller'>Protect the controller</a></li><li><a href='/en/merb-more/authentication#overwrite_the_default_views'>Overwrite the default views</a></li></ul></li><li><a href='/en/merb-more/authentication#testing_an_authenticated_request'>Testing an authenticated request</a></li></ul></li></ul>
+
+<ul class='toc'><li><a href='/en/merb-more/mailer'>Mailer</a></li></ul>
+
+<ul class='toc'><li><a href='/en/merb-more/caching'>Caching</a></li></ul>
+
+<ul class='toc'><li><a href='/en/merb-more/exceptions'>Exceptions</a></li></ul>
+
+<ul class='toc'><li><a href='/en/merb-more/slices'>Slices</a></li></ul>
View
2  ...4-testing-your-application/1-why.markdown → ...7-testing-your-application/1-why.markdown
@@ -1,4 +1,4 @@
-#¿Por qué hacer pruebas?
+# ¿Por qué hacer pruebas?
* Esto será una tabla de contenidos (este texto será pegado).
{:toc}
View
0  ...esting-your-application/2-models.markdown → ...esting-your-application/2-models.markdown
File renamed without changes
View
0  ...ting-your-application/3-requests.markdown → ...ting-your-application/3-requests.markdown
File renamed without changes
View
0  ...ting-your-application/4-cucumber.markdown → ...ting-your-application/4-cucumber.markdown
File renamed without changes
View
0  ...s/4-testing-your-application/toc.markdown → ...s/7-testing-your-application/toc.markdown
File renamed without changes
View
22 book-content/es/8-testing-your-application/1-why.markdown
@@ -0,0 +1,22 @@
+#Why test
+
+* This will become a table of contents (this text will be scraped).
+{:toc}
+
+It is important to test your application
+to ensure that you minimize the chances of [regression][].
+Merb stack's default testing framework uses the [RSpec][] testing framework
+and a combination of model, request, and integration specs.
+
+## Types of Tests
+
+### Models
+
+### Requests
+
+### Integration
+
+
+<!-- Links -->
+[regression]: http://en.wikipedia.org/wiki/Software_regression
+[RSpec]: http://rspec.info/
View
1  book-content/es/8-testing-your-application/2-models.markdown
@@ -0,0 +1 @@
+#Testing your models
View
1  book-content/es/8-testing-your-application/3-requests.markdown
@@ -0,0 +1 @@
+#Testing your requests
View
92 book-content/es/8-testing-your-application/4-cucumber.markdown
@@ -0,0 +1,92 @@
+#Integration testing with Cucumber
+
+* This will become a table of contents (this text will be scraped).
+{:toc}
+
+[Cucumber][] is the preferred method for integration testing your Merb
+applications.
+Cucumber is a tool that can execute "feature documentation"
+written in plain text.
+Here is an example of a typical Cucumber feature:
+
+ Feature: Login
+ To ensure the safety of the application
+ A regular user of the system
+ Must authenticate before using the app
+
+ Scenario: Failed Login
+ Given I am not authenticated
+ When I go to /login
+ And I fill in "login" with "i_dont_exist"
+ And I fill in "password" with "and_i_dont_have_a_password"
+ And I press "Log In"
+ Then the login request should fail
+ Then I should see an error message
+
+## Merb and Cucumber
+
+In order to use Cucumber with Merb,
+you need to install the [merb\_cucumber][] plugin.
+To install the plugin, run the command
+
+ $ sudo gem install merb_cucumber
+
+or, if you're using the local gems directory, run
+
+ $ thor merb:gem:install merb_cucumber
+
+Then, inside of your merb project root, run
+
+ $ merb-gen cucumber
+
+Or, to install with [Webrat][] support, run
+
+ $ merb-gen cucumber --session-type webrat
+
+This will also install the login feature shown above.
+This should pass if you’re using merb-auth.
+
+Running your features is then as simple as running
+
+ $ rake features
+
+## Creating new features
+
+To add a new feature definition to your Merb application, run
+
+ $ merb-gen feature FEATURE_NAME
+
+This will create a new feature named FEATURE\_NAME.feature in the features
+directory that looks like this:
+
+ Feature: add comment
+ To [accomplish some goal]
+ A [role]
+ Does [something]
+
+ Scenario: [first scenario]
+ Given [precondition]
+ And [another precondition]
+ When [event happens]
+ And [another event happens]
+ Then [outcome]
+ And [another outcome]
+
+ Scenario: [other scenario]
+ Given [precondition]
+ And [another precondition]
+ When [event happens]
+ And [another event happens]
+ Then [outcome]
+ And [another outcome]
+
+If you then run your features from the command line,
+you'll see that Cucumber gives you hints about how to implement each step.
+More information about implementing Cucumber features can be found
+on the [Cucumber wiki].
+
+<!-- Links -->
+[Cucumber]: http://github.com/aslakhellesoy/cucumber/wikis/home
+[Cucumber wiki]: http://github.com/aslakhellesoy/cucumber/wikis/home
+[merb\_cucumber]: http://github.com/david/merb_cucumber/tree/master
+[Webrat]: http://github.com/brynary/webrat/wikis
View
9 book-content/es/8-testing-your-application/toc.markdown
@@ -0,0 +1,9 @@
+# testing-your-application
+
+ <ul class='toc'><li><a href='/en/testing-your-application/why'>Why test</a><ul style='list-style: none;'><li><a href='/en/testing-your-application/why#types_of_tests'>Types of Tests</a><ul style='list-style: none;'><li><a href='/en/testing-your-application/why#models'>Models</a></li><li><a href='/en/testing-your-application/why#requests'>Requests</a></li><li><a href='/en/testing-your-application/why#integration'>Integration</a></li></ul></li></ul></li></ul>
+
+<ul class='toc'><li><a href='/en/testing-your-application/models'>Testing your models</a></li></ul>
+
+<ul class='toc'><li><a href='/en/testing-your-application/requests'>Testing your requests</a></li></ul>
+
+<ul class='toc'><li><a href='/en/testing-your-application/cucumber'>Integration testing with Cucumber</a><ul style='list-style: none;'><li><a href='/en/testing-your-application/cucumber#merb_and_cucumber'>Merb and Cucumber</a></li><li><a href='/en/testing-your-application/cucumber#creating_new_features'>Creating new features</a></li></ul></li></ul>
View
0  .../es/5-merb-more/1-authentication.markdown → .../es/9-merb-more/1-authentication.markdown
File renamed without changes
View
0  ...-content/es/5-merb-more/2-mailer.markdown → ...-content/es/9-merb-more/2-mailer.markdown
File renamed without changes
View
0  ...content/es/5-merb-more/3-caching.markdown → ...content/es/9-merb-more/3-caching.markdown
File renamed without changes
View
0  ...tent/es/5-merb-more/4-exceptions.markdown → ...tent/es/9-merb-more/4-exceptions.markdown
File renamed without changes
View
0  ...-content/es/5-merb-more/5-slices.markdown → ...-content/es/9-merb-more/5-slices.markdown
File renamed without changes
View
0  book-content/es/5-merb-more/toc.markdown → book-content/es/9-merb-more/toc.markdown
File renamed without changes

0 comments on commit e1363dc

Please sign in to comment.
Something went wrong with that request. Please try again.