Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
triskweline committed Jan 28, 2010
1 parent d0bacba commit 3bb2809
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.rdoc
Expand Up @@ -37,6 +37,12 @@ You can also refer to the last created object of a kind by saying "above":

{Machinist blueprints}[http://github.com/notahat/machinist] and {factory_girl factories}[http://github.com/thoughtbot/factory_girl] will be used when available.

You can use named Machinist blueprint such as <tt>Movie.blueprint(:comedy)</tt> like this:

Given a movie (comedy) with the title "Groundhog Day"

Inherited factory_girl factories are not supported yet.

=== Credits

Henning Koch
Expand Down
2 changes: 1 addition & 1 deletion cucumber_factory.gemspec
Expand Up @@ -5,7 +5,7 @@

Gem::Specification.new do |s|
s.name = %q{cucumber_factory}
s.version = "1.3.0"
s.version = "1.3.1"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Henning Koch"]
Expand Down
3 changes: 2 additions & 1 deletion lib/cucumber_factory/factory.rb
Expand Up @@ -52,7 +52,8 @@ def self.parse_creation(world, raw_model, raw_variant, raw_attributes)
association = model_class.reflect_on_association(attribute) if model_class.respond_to?(:reflect_on_association)
if association.present?
if value_type == "above"
value = association.klass.last or raise "There is no last #{attribute}"
# Don't use class.last, in sqlite that is not always the last inserted element
value = association.klass.find(:last, :order => "id") or raise "There is no last #{attribute}"
else
value = world.instance_variable_get(variable_name_from_prose(value))
end
Expand Down

0 comments on commit 3bb2809

Please sign in to comment.