Created
April 5, 2011 02:22
-
-
Save vinibaggio/902906 to your computer and use it in GitHub Desktop.
Fixture weird behavior
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fixtures/organizations.yml | |
my_organization: | |
name: My Organization | |
subdomain: myorganization | |
# spec | |
organization = organizations(:my_organization) | |
Factory(:site, :organization => organization) | |
# | |
# => FAILS: | |
# ActiveRecord::AssociationTypeMismatch: | |
# Organization(#2204084900) expected, got Organization(#2203981240) | |
# | |
# Debugging, i found out that: | |
# (rdb:1) organization | |
# => #<Organization id: 958087004, name: "My Organization", subdomain: "myorganization", owner_id: nil, created_at: "2011-04-05 02:18:32", updated_at: "2011-04-05 02:18:32"> | |
# (rdb:1) organization.is_a? Organization | |
# => false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment