Skip to content

Commit c7f83f9

Browse files
committed
Update tests
1 parent c343149 commit c7f83f9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Tests/KeystoneTests/Tests/Models/ReaderCardTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ReaderCardTests: CoreDataTestCase {
1111
let expectation = self.expectation(description: "Create a Reader Card of type post")
1212

1313
remoteCard(ofType: .post) { remoteCard in
14-
let card = ReaderCard(context: self.mainContext, from: remoteCard)
14+
let card = ReaderCard.createOrReuse(context: self.mainContext, from: remoteCard)
1515

1616
expect(card?.post).toNot(beNil())
1717
expect(card?.post?.postTitle).to(equal("Pats, Please"))
@@ -28,7 +28,7 @@ class ReaderCardTests: CoreDataTestCase {
2828
let expectation = self.expectation(description: "Create a Reader Card of type interests")
2929

3030
remoteCard(ofType: .interests) { remoteCard in
31-
let card = ReaderCard(context: self.mainContext, from: remoteCard)
31+
let card = ReaderCard.createOrReuse(context: self.mainContext, from: remoteCard)
3232
let topics = card?.topicsArray
3333

3434
// THEN return 0 as these were disabled in 26.5
@@ -45,7 +45,7 @@ class ReaderCardTests: CoreDataTestCase {
4545
let expectation = self.expectation(description: "Create a Reader Card of type sites")
4646

4747
remoteCard(ofType: .sites) { remoteCard in
48-
let card = ReaderCard(context: self.mainContext, from: remoteCard)
48+
let card = ReaderCard.createOrReuse(context: self.mainContext, from: remoteCard)
4949
let topics = card?.sitesArray
5050

5151
expect(topics?.count).to(equal(1))
@@ -63,7 +63,7 @@ class ReaderCardTests: CoreDataTestCase {
6363
let expectation = self.expectation(description: "Don't create a Reader Card")
6464

6565
remoteCard(ofType: .unknown) { remoteCard in
66-
let card = ReaderCard(context: self.mainContext, from: remoteCard)
66+
let card = ReaderCard.createOrReuse(context: self.mainContext, from: remoteCard)
6767

6868
expect(card).to(beNil())
6969
expectation.fulfill()

Tests/KeystoneTests/Tests/Services/ReaderCardServiceTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ReaderCardServiceTests: CoreDataTestCase {
2626

2727
service.fetch(isFirstPage: true, success: { _, _ in
2828
let cards = try? self.mainContext.fetch(NSFetchRequest(entityName: ReaderCard.classNameWithoutNamespaces()))
29-
expect(cards?.count).to(equal(10))
29+
expect(cards?.count).to(equal(9))
3030
expectation.fulfill()
3131
}, failure: { _ in })
3232

@@ -74,7 +74,7 @@ class ReaderCardServiceTests: CoreDataTestCase {
7474
// Fetch again, this time the 1st page
7575
service.fetch(isFirstPage: true, success: { _, _ in
7676
let cards = try? self.mainContext.fetch(NSFetchRequest(entityName: ReaderCard.classNameWithoutNamespaces())) as? [ReaderCard]
77-
expect(cards?.count).to(equal(10))
77+
expect(cards?.count).to(equal(9))
7878
expectation.fulfill()
7979
}, failure: { _ in })
8080
}, failure: {_ in })

0 commit comments

Comments
 (0)