acacha
460
8
Testing

Testing a 403 response status after submiting a Form in Laravel 5.1

Posted 3 years ago by acacha

I'm stucked how can I test I expect a response code status of 403 (because my app control user permisions on creating model regulation in example and returns a 403 if user is not allowed to create a regulation):

$this->actingAs($user)
            ->withSession(['applocalemodel' => 'ca'])
            ->visit('/admin/regulations/create')
            ->type('Norma de prova no funcionarà', 'name')
            ->press('Guardar')
            ->?????????????();

What I've to put on ??????????? to test a response code of 403?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.