+ public function test_update_endpoint_does_not_wipe_content_if_no_html_or_md_provided()
+ {
+ $this->actingAsApiEditor();
+ $page = Page::visible()->first();
+ $originalContent = $page->html;
+ $details = [
+ 'name' => 'My updated API page',
+ 'tags' => [
+ [
+ 'name' => 'freshtag',
+ 'value' => 'freshtagval',
+ ],
+ ],
+ ];
+
+ $this->putJson($this->baseEndpoint . "/{$page->id}", $details);
+ $page->refresh();
+
+ $this->assertEquals($originalContent, $page->html);
+ }
+
+ public function test_update_increments_updated_date_if_only_tags_are_sent()
+ {
+ $this->actingAsApiEditor();
+ $page = Page::visible()->first();
+ DB::table('pages')->where('id', '=', $page->id)->update(['updated_at' => Carbon::now()->subWeek()]);
+
+ $details = [
+ 'tags' => [['name' => 'Category', 'value' => 'Testing']],
+ ];
+
+ $resp = $this->putJson($this->baseEndpoint . "/{$page->id}", $details);
+ $resp->assertOk();
+
+ $page->refresh();
+ $this->assertGreaterThan(Carbon::now()->subDay()->unix(), $page->updated_at->unix());
+ }
+