Skip to content

Commit 9b783a5

Browse files
committed
fix testcode query
1 parent 9f0ec87 commit 9b783a5

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

test/ar_sync_test.rb

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,29 @@
99
end
1010
end
1111

12-
query = [name: { as: '名前' }, posts: [:user, :title, as: :articles, my_comments: [:star_count, as: :my_opinions], comments: [:star_count, :user, my_stars: :id, my_star: { as: :my_reaction }]]]
13-
post_query = [:user, :title, comments: [:body, as: :cmnts]]
14-
collection_query = [:user, :title, my_comments: [:star_count, as: :my_opinions], comments: [:star_count, :user, my_stars: :id, my_star: { as: :my_reaction }]]
12+
query = {
13+
名前: { field: :name },
14+
articles: {
15+
field: :posts,
16+
query: {
17+
user: true, title: true,
18+
my_opinions: { field: :my_comments, query: :star_count },
19+
comments: {
20+
star_count: true, user: true, my_stars: :id,
21+
my_reaction: { field: :my_star }
22+
}
23+
}
24+
}
25+
}
26+
post_query = { user: true, title: true, cmnts: { field: :comments, query: :body } }
27+
collection_query = {
28+
user: true, title: true,
29+
my_opinions: { field: :my_comments, query: :star_count },
30+
comments: {
31+
star_count: true, user: true, my_stars: :id,
32+
my_reaction: { field: :my_star }
33+
}
34+
}
1535

1636
$test_cases = {
1737
user: [Tree::User.first, query],

0 commit comments

Comments
 (0)