aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/associations_go_eager_test.rb4
-rwxr-xr-xactiverecord/test/fixtures/db_definitions/mysql.sql2
-rw-r--r--activerecord/test/fixtures/db_definitions/postgresql.sql4
-rw-r--r--activerecord/test/fixtures/db_definitions/sqlite.sql2
-rw-r--r--activerecord/test/fixtures/posts.yml1
5 files changed, 6 insertions, 7 deletions
diff --git a/activerecord/test/associations_go_eager_test.rb b/activerecord/test/associations_go_eager_test.rb
index 498d557a02..0bd887478d 100644
--- a/activerecord/test/associations_go_eager_test.rb
+++ b/activerecord/test/associations_go_eager_test.rb
@@ -10,11 +10,11 @@ class EagerAssociationTest < Test::Unit::TestCase
def test_loading_with_one_association
posts = Post.find(:all, :include => :comments)
assert_equal 2, posts.first.comments.size
- assert_equal @greetings.body, posts.first.comments.first.body
+ assert posts.first.comments.include?(@greetings)
post = Post.find(:first, :include => :comments, :conditions => "posts.title = 'Welcome to the weblog'")
assert_equal 2, post.comments.size
- assert_equal @greetings.body, post.comments.first.body
+ assert post.comments.include?(@greetings)
end
def test_loading_with_multiple_associations
diff --git a/activerecord/test/fixtures/db_definitions/mysql.sql b/activerecord/test/fixtures/db_definitions/mysql.sql
index 8e263310ab..294f227be3 100755
--- a/activerecord/test/fixtures/db_definitions/mysql.sql
+++ b/activerecord/test/fixtures/db_definitions/mysql.sql
@@ -131,7 +131,7 @@ CREATE TABLE `computers` (
CREATE TABLE `posts` (
`id` INTEGER NOT NULL PRIMARY KEY,
- `author_id` INTEGER NOT NULL,
+ `author_id` INTEGER,
`title` VARCHAR(255) NOT NULL,
`body` TEXT NOT NULL,
`type` VARCHAR(255) NOT NULL
diff --git a/activerecord/test/fixtures/db_definitions/postgresql.sql b/activerecord/test/fixtures/db_definitions/postgresql.sql
index ae41f80788..2bc18dfb2b 100644
--- a/activerecord/test/fixtures/db_definitions/postgresql.sql
+++ b/activerecord/test/fixtures/db_definitions/postgresql.sql
@@ -167,7 +167,7 @@ CREATE TABLE authors (
name varchar(255) default NULL
);
-CREATE TABLE taske (
+CREATE TABLE tasks (
id serial,
starting timestamp,
ending timestamp,
@@ -181,5 +181,5 @@ CREATE TABLE categories (
CREATE TABLE categories_posts (
category_id integer NOT NULL,
- post_id int integer NOT NULL
+ post_id integer NOT NULL
);
diff --git a/activerecord/test/fixtures/db_definitions/sqlite.sql b/activerecord/test/fixtures/db_definitions/sqlite.sql
index 2a26ff8c37..33c85b4d1c 100644
--- a/activerecord/test/fixtures/db_definitions/sqlite.sql
+++ b/activerecord/test/fixtures/db_definitions/sqlite.sql
@@ -118,7 +118,7 @@ CREATE TABLE 'computers' (
CREATE TABLE 'posts' (
'id' INTEGER NOT NULL PRIMARY KEY,
- 'author_id' INTEGER NOT NULL,
+ 'author_id' INTEGER,
'title' VARCHAR(255) NOT NULL,
'type' VARCHAR(255) NOT NULL,
'body' TEXT NOT NULL
diff --git a/activerecord/test/fixtures/posts.yml b/activerecord/test/fixtures/posts.yml
index 9d22b2a603..037f0a2323 100644
--- a/activerecord/test/fixtures/posts.yml
+++ b/activerecord/test/fixtures/posts.yml
@@ -14,7 +14,6 @@ thinking:
authorless:
id: 3
- author_id: ""
title: I don't have any comments
body: I just don't want to
type: Post