diff --git a/tests/initdb.sql b/tests/initdb.sql index 0e61d04..844873d 100644 --- a/tests/initdb.sql +++ b/tests/initdb.sql @@ -11,6 +11,7 @@ CREATE TABLE models ( -- Insert default data. INSERT INTO models(name, amount) VALUES ('test', 50); +INSERT INTO models(name, amount) VALUES ('updatable', 33.12); -- Create default composite models table. CREATE TABLE composite_models ( diff --git a/tests/repository.zig b/tests/repository.zig index 1e0eb25..199649b 100644 --- a/tests/repository.zig +++ b/tests/repository.zig @@ -250,7 +250,7 @@ test "repository element update" { // Update a model's name. try updateQuery.set(.{ .name = "newname" }); - try updateQuery.whereValue(usize, "id", "=", 1); + try updateQuery.whereValue(usize, "id", "=", 2); updateQuery.returningAll(); // Build SQL. @@ -267,7 +267,7 @@ test "repository element update" { // Check the updated model. try std.testing.expectEqual(1, result.models.len); - try std.testing.expectEqual(1, result.models[0].id); + try std.testing.expectEqual(2, result.models[0].id); try std.testing.expectEqualStrings("newname", result.models[0].name); }