Skip to content

Commit b4776a3

Browse files
committed
Add test
Add test
1 parent c96c870 commit b4776a3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

diesel_tests/tests/boxed_queries.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,14 @@ fn can_box_query_with_boxable_expression() {
179179
let expected = vec![find_user_by_name("Sean", connection)];
180180
assert_eq!(Ok(expected), data);
181181
}
182+
183+
#[test]
184+
fn can_box_query_having_with_boxable_expression() {
185+
let connection = &mut connection_with_sean_and_tess_in_users_table();
186+
187+
let expr: Box<dyn BoxableExpression<users::table, _, SqlType = _>> =
188+
Box::new(count(users::id).eq(2)) as _;
189+
190+
use diesel::dsl::count;
191+
let data: Vec<i64> = users::table.select(count(users::id)).group_by(users::id).having(expr).into_boxed().load(connection).expect("db error");
192+
}

0 commit comments

Comments
 (0)