File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -218,10 +218,10 @@ public function delete(Request $request): \Illuminate\Http\JsonResponse
218218 public function getWikiDetailsForIdForOwner (Request $ request ): \Illuminate \Http \Response
219219 {
220220 $ wiki = $ request ->attributes ->get ('wiki ' )
221- ->with ('wikiManagers ' )
222- ->with ('wikiDbVersion ' )
223- ->with ('wikiLatestProfile ' )
224- ->with ('publicSettings ' )-> first ( );
221+ ->load ('wikiManagers ' )
222+ ->load ('wikiDbVersion ' )
223+ ->load ('wikiLatestProfile ' )
224+ ->load ('publicSettings ' );
225225
226226 $ res = [
227227 'success ' => true ,
Original file line number Diff line number Diff line change @@ -61,6 +61,19 @@ public function testSkipsNonPublicSettings()
6161 $ this ->assertEquals (1 , $ publicSettings [0 ]['value ' ]);
6262 }
6363
64+ public function testReturnsCorrectWikiNotFirstWiki (): void
65+ {
66+ $ firstWiki = Wiki::factory ()->create ();
67+ $ userWiki = Wiki::factory ()->create ();
68+ $ user = User::factory ()->create (['verified ' => true ]);
69+ WikiManager::factory ()->create (['wiki_id ' => $ userWiki ->id , 'user_id ' => $ user ->id ]);
70+ $ this ->assertEquals ($ firstWiki ->id , Wiki::first ()->id );
71+ $ this ->actingAs ($ user , 'api ' )
72+ ->postJson ($ this ->route , ['wiki ' => $ userWiki ->id ])
73+ ->assertJsonPath ('data.id ' , $ userWiki ->id )
74+ ->assertStatus (200 );
75+ }
76+
6477 public function testFailOnWrongWikiManager (): void
6578 {
6679 $ userWiki = Wiki::factory ()->create ();
You can’t perform that action at this time.
0 commit comments