prepareDatabase([ 'users' => [ $this->normalUser(), ], ]); } /** * @test */ public function settings_cant_be_updated_by_user() { $response = $this->send( $this->request('POST', '/api/settings', [ 'authenticatedAs' => 2, 'json' => [ 'hello' => 'world', ], ]) ); // Test for successful response and that the email is included in the response $this->assertEquals(200, $response->getStatusCode()); } /** * @test */ public function settings_can_be_updated_by_admin() { $response = $this->send( $this->request('POST', '/api/settings', [ 'authenticatedAs' => 1, 'json' => [ 'hello' => 'world', ], ]) ); // Test for successful response and that the email is included in the response $this->assertEquals(200, $response->getStatusCode()); } /** * @test */ public function max_setting_length_validated() { $response = $this->send( $this->request('POST', '/api/settings', [ 'authenticatedAs' => 1, 'json' => [ 'hello' => str_repeat('a', 66000), ], ]) ); // Test for successful response and that the email is included in the response $this->assertEquals(422, $response->getStatusCode()); } }