Hi all,

I'm working on an ActiveRecord contribution, and I seem to be set up to run 
tests properly, but I have 2 failures occurring when I run `rake test` from 
within /activerecord. I am running PostgreSQL 9.1, so perhaps there is 
currently a problem running tests against that?

Has anyone else tried running these tests using PostgreSQL 9.1, and if so, 
do you see the same failures I'm seeing?

If this is a 9.1 problem, then I'll be happy to investigate it as part of 
the contribution I'm working on, but I would first want to make sure that 
really is the problem I'm seeing, and it's not caused by some other thing 
I've messed up with my configuration or process.

Here is the failure output...

  1) Failure:
test_eager_loading_with_conditions_on_join_model_preloads(EagerAssociationTest) 
[/Users/FileVault/stevej/Projects/rails/activerecord/test/cases/associations/
*eager_test.rb:1015*]:
*4 instead of 2 queries were executed*.
Queries:
SELECT "authors".* FROM "authors" INNER JOIN "posts" ON "posts"."author_id" 
= "authors"."id" INNER JOIN "comments" ON "comments"."post_id" = 
"posts"."id" WHERE (posts.title like 'Welcome%')
            SELECT COUNT(*)
            FROM pg_class c
            LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
            WHERE c.relkind in ('v','r')
            AND c.relname = $1
            AND n.nspname = ANY (current_schemas(false))

            SELECT a.attname, format_type(a.atttypid, a.atttypmod), 
d.adsrc, a.attnotnull, a.atttypid, a.atttypmod
              FROM pg_attribute a LEFT JOIN pg_attrdef d
                ON a.attrelid = d.adrelid AND a.attnum = d.adnum
             WHERE a.attrelid = '"author_addresses"'::regclass
               AND a.attnum > 0 AND NOT a.attisdropped
             ORDER BY a.attnum

SELECT "author_addresses".* FROM "author_addresses"  WHERE 
"author_addresses"."id" IN (1).
Expected: 2
  Actual: 4

  2) Failure:
test_custom_primary_key_on_new_record_should_fetch_with_query(HasManyAssociationsTest)
 
[/Users/FileVault/stevej/Projects/rails/activerecord/test/cases/associations/
*has_many_associations_test.rb:1342*]:
*2 instead of 1 queries were executed*.
Queries:
            SELECT COUNT(*)
            FROM pg_class c
            LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
            WHERE c.relkind in ('v','r')
            AND c.relname = $1
            AND n.nspname = ANY (current_schemas(false))

SELECT COUNT(*) FROM "essays"  WHERE "essays"."writer_id" = $1 AND 
"essays"."writer_type" = $2.
Expected: 1
  Actual: 2

Thanks,

-- S.J.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-core/-/VGaNzBMDcdoJ.
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-core?hl=en.

Reply via email to