views:

440

answers:

0

To start out, here is the failing message:

ActiveRecord::RecordInvalid in 'Event should be valid'
Validation failed: Single access token has already been taken, Login has already been taken, Email has already been taken

Here is my factory:

Factory.define :valid_event, :class => Event do |e|
  e.event_date "2010-01-01"
  e.critter { |c| c.association(:valid_critter) }
  e.user { |u| u.association(:valid_user) }
end

The user is what is giving me the problem (if I remove that e.user line and remove the validates_presence_of from the Event model, then everything passes).

But what I don't understand is why it is failing. I'm not even sure where to start looking or what info might be needed to debug this...so just ask and I'll provide whatever additional info is needed.

Here's the valid_user Factory definition:

Factory.define :valid_user , :class => User do |u|
  u.login "josh"
  u.password "donkey"
  u.password_confirmation "donkey"
  u.email "[email protected]"
  u.single_access_token "k3cFzLIQnZ4MHRmJvJzg"
end