Skip to content

Commit c604428

Browse files
committed
Workaround order dependent test failure
1 parent 651b99f commit c604428

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

test/adapter/json_api/linked_test.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ def setup
1010
@author2 = Author.new(id: 2, name: 'Tenderlove')
1111
@bio1 = Bio.new(id: 1, content: 'AMS Contributor')
1212
@bio2 = Bio.new(id: 2, content: 'Rails Contributor')
13-
@first_post = Post.new(id: 1, title: 'Hello!!', body: 'Hello, world!!')
14-
@second_post = Post.new(id: 2, title: 'New Post', body: 'Body')
15-
@third_post = Post.new(id: 3, title: 'Yet Another Post', body: 'Body')
13+
@first_post = Post.new(id: 10, title: 'Hello!!', body: 'Hello, world!!')
14+
@second_post = Post.new(id: 20, title: 'New Post', body: 'Body')
15+
@third_post = Post.new(id: 30, title: 'Yet Another Post', body: 'Body')
1616
@blog = Blog.new({ name: 'AMS Blog' })
1717
@first_post.blog = @blog
1818
@second_post.blog = @blog
@@ -44,8 +44,8 @@ def test_include_multiple_posts_and_linked
4444
@second_comment.post = @first_post
4545
@second_comment.author = nil
4646
assert_equal([
47-
{ title: "Hello!!", body: "Hello, world!!", id: "1", links: { comments: ['1', '2'], blog: "999", author: "1" } },
48-
{ title: "New Post", body: "Body", id: "2", links: { comments: [], blog: "999", author: "2" } }
47+
{ title: "Hello!!", body: "Hello, world!!", id: "10", links: { comments: ['1', '2'], blog: "999", author: "1" } },
48+
{ title: "New Post", body: "Body", id: "20", links: { comments: [], blog: "999", author: "2" } }
4949
], @adapter.serializable_hash[:posts])
5050

5151

@@ -54,30 +54,30 @@ def test_include_multiple_posts_and_linked
5454
id: "1",
5555
body: "ZOMG A COMMENT",
5656
links: {
57-
post: "1",
57+
post: "10",
5858
author: nil
5959
}
6060
}, {
6161
id: "2",
6262
body: "ZOMG ANOTHER COMMENT",
6363
links: {
64-
post: "1",
64+
post: "10",
6565
author: nil
6666
}
6767
}],
6868
authors: [{
6969
id: "1",
7070
name: "Steve K.",
7171
links: {
72-
posts: ["1", "3"],
72+
posts: ["10", "30"],
7373
roles: [],
7474
bio: "1"
7575
}
7676
}, {
7777
id: "2",
7878
name: "Tenderlove",
7979
links: {
80-
posts: ["2"],
80+
posts: ["20"],
8181
roles: [],
8282
bio: "2"
8383
}
@@ -117,15 +117,15 @@ def test_include_bio_and_linked
117117
id: "1",
118118
name: "Steve K.",
119119
links: {
120-
posts: ["1", "3"],
120+
posts: ["10", "30"],
121121
roles: [],
122122
bio: "1"
123123
}
124124
}],
125125
posts: [{
126126
title: "Hello!!",
127127
body: "Hello, world!!",
128-
id: "1",
128+
id: "10",
129129
links: {
130130
comments: ["1", "2"],
131131
blog: "999",
@@ -134,7 +134,7 @@ def test_include_bio_and_linked
134134
}, {
135135
title: "Yet Another Post",
136136
body: "Body",
137-
id: "3",
137+
id: "30",
138138
links: {
139139
comments: [],
140140
blog: nil,

0 commit comments

Comments
 (0)