Skip to content

Commit

Permalink
fix testcode query
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng committed May 26, 2019
1 parent 9f0ec87 commit 9b783a5
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions test/ar_sync_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,29 @@
end
end

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 }]]]
post_query = [:user, :title, comments: [:body, as: :cmnts]]
collection_query = [:user, :title, my_comments: [:star_count, as: :my_opinions], comments: [:star_count, :user, my_stars: :id, my_star: { as: :my_reaction }]]
query = {
名前: { field: :name },
articles: {
field: :posts,
query: {
user: true, title: true,
my_opinions: { field: :my_comments, query: :star_count },
comments: {
star_count: true, user: true, my_stars: :id,
my_reaction: { field: :my_star }
}
}
}
}
post_query = { user: true, title: true, cmnts: { field: :comments, query: :body } }
collection_query = {
user: true, title: true,
my_opinions: { field: :my_comments, query: :star_count },
comments: {
star_count: true, user: true, my_stars: :id,
my_reaction: { field: :my_star }
}
}

$test_cases = {
user: [Tree::User.first, query],
Expand Down

0 comments on commit 9b783a5

Please sign in to comment.