You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// use actual remote object so the request can be intercepted by HTTPStubs.
51
+
service =BloggingPromptsService(contextManager: contextManager, blog: blog)
52
+
stubFetchPromptsResponse()
53
+
43
54
letexpectation=expectation(description:"Fetch prompts should succeed")
55
+
service.fetchPrompts(from:.init(timeIntervalSince1970:0)){ prompts in
56
+
XCTAssertEqual(prompts.count,2)
57
+
58
+
// Verify mappings for the first prompt
59
+
letfirstPrompt= prompts.first!
60
+
XCTAssertEqual(firstPrompt.promptID,239)
61
+
XCTAssertEqual(firstPrompt.text,"Was there a toy or thing you always wanted as a child, during the holidays or on your birthday, but never received? Tell us about it.")
62
+
XCTAssertEqual(firstPrompt.title,"Prompt number 1")
63
+
XCTAssertEqual(firstPrompt.content,"<!-- wp:pullquote -->\n<figure class=\"wp-block-pullquote\"><blockquote><p>Was there a toy or thing you always wanted as a child, during the holidays or on your birthday, but never received? Tell us about it.</p><cite>(courtesy of plinky.com)</cite></blockquote></figure>\n<!-- /wp:pullquote -->")
XCTAssertEqual(secondPrompt.text,"Tell us about a time when you felt out of place.")
80
+
XCTAssertEqual(secondPrompt.title,"Prompt number 10")
81
+
XCTAssertEqual(secondPrompt.content,"<!-- wp:pullquote -->\n<figure class=\"wp-block-pullquote\"><blockquote><p>Tell us about a time when you felt out of place.</p><cite>(courtesy of plinky.com)</cite></blockquote></figure>\n<!-- /wp:pullquote -->")
"text": "Was there a toy or thing you always wanted as a child, during the holidays or on your birthday, but never received? Tell us about it.",
6
+
"title": "Prompt number 1",
7
+
"content": "<!-- wp:pullquote -->\n<figure class=\"wp-block-pullquote\"><blockquote><p>Was there a toy or thing you always wanted as a child, during the holidays or on your birthday, but never received? Tell us about it.</p><cite>(courtesy of plinky.com)</cite></blockquote></figure>\n<!-- /wp:pullquote -->",
8
+
"attribution": "dayone",
9
+
"date": "2022-05-03",
10
+
"answered": false,
11
+
"answered_users_count": 0,
12
+
"answered_users_sample": []
13
+
},
14
+
{
15
+
"id": 248,
16
+
"text": "Tell us about a time when you felt out of place.",
17
+
"title": "Prompt number 10",
18
+
"content": "<!-- wp:pullquote -->\n<figure class=\"wp-block-pullquote\"><blockquote><p>Tell us about a time when you felt out of place.</p><cite>(courtesy of plinky.com)</cite></blockquote></figure>\n<!-- /wp:pullquote -->",
0 commit comments