Figured it out. Here's the summary:
If you have a sequence called :xyz and you are calling it in a
factory, YOU NEED TO HAVE BRACKETS around the Factory.next(:xyz)
call. In my case:
# Factories
Factory.define :article do |t|
t.association :section # 'belongs to a section'
t.title {|x| "Article#{Factory.next(:count)}" }
(...)
end
(...)
Factory.define :page do |t|
t.title { "Page#{Factory.next(:count)}" } # I originally
didn't have brackets here; that's why it didn't work, while it did
work above!
(...)
end
# Sequences
Factory.sequence :count do |n|
n
end
Hope this helps people who come across the same issue.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.