File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,14 @@ struct MigrationTests {
16
16
let context154 = contextManager154. newDerivedContext ( )
17
17
let blog = BlogBuilder ( context154)
18
18
. build ( )
19
+
20
+ // BlogAuthor is one of the Swift-first models that needed module reference updates in
21
+ // https://github.com/wordpress-mobile/WordPress-iOS/pull/24494
22
+ let author = NSEntityDescription . insertNewObject (
23
+ forEntityName: BlogAuthor . entityName ( ) ,
24
+ into: context154
25
+ ) as! BlogAuthor
26
+
19
27
contextManager154. saveContextAndWait ( context154)
20
28
21
29
// Create a context manager for the 155 model, it will run the migration automatically
@@ -31,5 +39,11 @@ struct MigrationTests {
31
39
let results = try context155. fetch ( request)
32
40
#expect( results. count == 1 )
33
41
#expect( ( results. first as? Blog ) ? . url == blog. url)
42
+
43
+ let authorRequest = BlogAuthor . fetchRequest ( )
44
+ authorRequest. predicate = NSPredicate ( format: " userId == %@ " , author. userID)
45
+ let authorResults = try context155. fetch ( authorRequest)
46
+ #expect( authorResults. count == 1 )
47
+ #expect( ( authorResults. first as? Blog ) ? . url == blog. url)
34
48
}
35
49
}
You can’t perform that action at this time.
0 commit comments