Skip to content

Commit

Permalink
Simple creation test completed
Browse files Browse the repository at this point in the history
  • Loading branch information
nando committed Oct 16, 2009
1 parent 695c4f2 commit 4ad0839
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
16 changes: 6 additions & 10 deletions features/en_US/simple-creation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Feature: Simple creation
# Given (that we have)? _number_ _modelo_( called _name_)
#
# Description:
# TODO: To translate this:
# Nos crea una o más instancias de un modelo con la posibilidad de
# asociar a las mismas un _nombre_ determinado.
#
Expand Down Expand Up @@ -37,18 +38,13 @@ Feature: Simple creation
########################################################################
Given an orchard
And one orchard
And a tomatoe
And a tomatoe "Red Tomatoe"
And a tomatoe called "Dark Red Tomatoe"
And 2 orchards
And 2 orchards "Irrigated"
And 2 orchards called "Unirrigated"
And 3 orchards called "H-01, H-02 y H-03"
Then we have 11 orchards in our database
# Y tenemos en bbdd un huerto "En el río"
# Y tenemos en bbdd una huerta "En el castro"
# Y tenemos en bbdd 3 huertos "Regadío"
# Y tenemos en bbdd 5 huertas "Secano"
# Y tenemos en bbdd un huerto "H-01"
# Y tenemos en bbdd un huerto "H-02"
# Y tenemos en bbdd un huerto "H-03"
And we have two orchards "Irrigated" in our database
And we have two orchards "Unirrigated" in our database
And we have a orchard "H-01" in our database
And we have a orchard "H-02" in our database
And we have a orchard "H-03" in our database
4 changes: 2 additions & 2 deletions lib/mundo_pepino/definitions/en_US.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/^tru(e|th)$/i => true,
/^false$/i => false
}) { |value| value } # "true".to_real_value # => true
String.add_mapper(:field, {:nombre => 'name'})
String.add_mapper(:field, {:nombre => :name})

String.add_mapper(:url, /^the home(page)?/i => '/') do |string|
string if string =~ /^\/.*$|^https?:\/\//i
Expand Down Expand Up @@ -36,6 +36,6 @@
given_we_have_a_number_of_instances_called number, model, name
end

Then /^we have (#{number}) (.+)(?: (?:called )?['"](.+)["'])? in our database$/ do |number, model, names|
Then /^we have (#{number}) ([^ ]+)(?: (?:called )?['"](.+)["'])? in our database$/ do |number, model, names|
then_we_have_a_number_of_instances_in_our_database number, model, names
end

0 comments on commit 4ad0839

Please sign in to comment.