Workaround order dependent test failure

This commit is contained in:
Gary Gordon 2015-03-01 13:46:44 -05:00
parent 651b99f22e
commit c6044286ef

View File

@ -10,9 +10,9 @@ module ActiveModel
@author2 = Author.new(id: 2, name: 'Tenderlove') @author2 = Author.new(id: 2, name: 'Tenderlove')
@bio1 = Bio.new(id: 1, content: 'AMS Contributor') @bio1 = Bio.new(id: 1, content: 'AMS Contributor')
@bio2 = Bio.new(id: 2, content: 'Rails Contributor') @bio2 = Bio.new(id: 2, content: 'Rails Contributor')
@first_post = Post.new(id: 1, title: 'Hello!!', body: 'Hello, world!!') @first_post = Post.new(id: 10, title: 'Hello!!', body: 'Hello, world!!')
@second_post = Post.new(id: 2, title: 'New Post', body: 'Body') @second_post = Post.new(id: 20, title: 'New Post', body: 'Body')
@third_post = Post.new(id: 3, title: 'Yet Another Post', body: 'Body') @third_post = Post.new(id: 30, title: 'Yet Another Post', body: 'Body')
@blog = Blog.new({ name: 'AMS Blog' }) @blog = Blog.new({ name: 'AMS Blog' })
@first_post.blog = @blog @first_post.blog = @blog
@second_post.blog = @blog @second_post.blog = @blog
@ -44,8 +44,8 @@ module ActiveModel
@second_comment.post = @first_post @second_comment.post = @first_post
@second_comment.author = nil @second_comment.author = nil
assert_equal([ assert_equal([
{ title: "Hello!!", body: "Hello, world!!", id: "1", links: { comments: ['1', '2'], blog: "999", author: "1" } }, { title: "Hello!!", body: "Hello, world!!", id: "10", links: { comments: ['1', '2'], blog: "999", author: "1" } },
{ title: "New Post", body: "Body", id: "2", links: { comments: [], blog: "999", author: "2" } } { title: "New Post", body: "Body", id: "20", links: { comments: [], blog: "999", author: "2" } }
], @adapter.serializable_hash[:posts]) ], @adapter.serializable_hash[:posts])
@ -54,14 +54,14 @@ module ActiveModel
id: "1", id: "1",
body: "ZOMG A COMMENT", body: "ZOMG A COMMENT",
links: { links: {
post: "1", post: "10",
author: nil author: nil
} }
}, { }, {
id: "2", id: "2",
body: "ZOMG ANOTHER COMMENT", body: "ZOMG ANOTHER COMMENT",
links: { links: {
post: "1", post: "10",
author: nil author: nil
} }
}], }],
@ -69,7 +69,7 @@ module ActiveModel
id: "1", id: "1",
name: "Steve K.", name: "Steve K.",
links: { links: {
posts: ["1", "3"], posts: ["10", "30"],
roles: [], roles: [],
bio: "1" bio: "1"
} }
@ -77,7 +77,7 @@ module ActiveModel
id: "2", id: "2",
name: "Tenderlove", name: "Tenderlove",
links: { links: {
posts: ["2"], posts: ["20"],
roles: [], roles: [],
bio: "2" bio: "2"
} }
@ -117,7 +117,7 @@ module ActiveModel
id: "1", id: "1",
name: "Steve K.", name: "Steve K.",
links: { links: {
posts: ["1", "3"], posts: ["10", "30"],
roles: [], roles: [],
bio: "1" bio: "1"
} }
@ -125,7 +125,7 @@ module ActiveModel
posts: [{ posts: [{
title: "Hello!!", title: "Hello!!",
body: "Hello, world!!", body: "Hello, world!!",
id: "1", id: "10",
links: { links: {
comments: ["1", "2"], comments: ["1", "2"],
blog: "999", blog: "999",
@ -134,7 +134,7 @@ module ActiveModel
}, { }, {
title: "Yet Another Post", title: "Yet Another Post",
body: "Body", body: "Body",
id: "3", id: "30",
links: { links: {
comments: [], comments: [],
blog: nil, blog: nil,