Skip to content

Commit 84c4e2a

Browse files
authored
Do not hard code project id in expected error message (#675)
1 parent 520af2c commit 84c4e2a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

firestore/integration_test_internal/src/validation_test.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,15 +519,17 @@ TEST_F(ValidationTest, WritesMayContainIndirectlyNestedLists) {
519519
}
520520

521521
TEST_F(ValidationTest, WritesMustNotContainReferencesToADifferentDatabase) {
522+
auto project_id = TestFirestore()->app()->options().project_id();
522523
DocumentReference ref =
523524
TestFirestoreWithProjectId(/*name=*/"db2", /*project_id=*/"different-db")
524525
->Document("baz/quu");
525526
auto data = FieldValue::Reference(ref);
526527

527528
ExpectWriteError(MapFieldValue{{"foo", data}},
528529
"Invalid data. Document reference is for database "
529-
"different-db/(default) but should be for database "
530-
"cpp-firestore-test-app/(default) (found in field foo)");
530+
"different-db/(default) but should be for database " +
531+
std::string(project_id) +
532+
"/(default) (found in field foo)");
531533
}
532534

533535
TEST_F(ValidationTest, WritesMustNotContainReservedFieldNames) {

0 commit comments

Comments
 (0)