Navigation Menu

Skip to content

Commit

Permalink
test: in_values tests should be under filter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 13, 2017
1 parent a7ad19d commit 8a3396e
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions test/request/test-select.rb
Expand Up @@ -91,6 +91,28 @@ def filter(*args)
"number" => 29
}))
end

sub_test_case("#in_values") do
def in_values(*args)
@request.filter.in_values(*args).to_parameters
end

test("numbers") do
assert_equal({
:table => "posts",
:filter => "in_values(ages, 2, 29)",
},
in_values("ages", 2, 29))
end

test("strings") do
assert_equal({
:table => "posts",
:filter => "in_values(tags, \"groonga\", \"have \\\"double\\\" quote\")",
},
in_values("tags", "groonga", "have \"double\" quote"))
end
end
end

sub_test_case("#drilldowns") do
Expand Down Expand Up @@ -384,27 +406,5 @@ def paginate(*args)
paginate(3, per_page: "29"))
end
end

sub_test_case("#in_values") do
def in_values(*args)
@request.filter.in_values(*args).to_parameters
end

test("numbers") do
assert_equal({
:table => "posts",
:filter => "in_values(ages, 2, 29)",
},
in_values("ages", 2, 29))
end

test("strings") do
assert_equal({
:table => "posts",
:filter => "in_values(tags, \"groonga\", \"have \\\"double\\\" quote\")",
},
in_values("tags", "groonga", "have \"double\" quote"))
end
end
end
end

0 comments on commit 8a3396e

Please sign in to comment.