Skip to content
Permalink
Browse files

Episode 19 Complete

  • Loading branch information...
JeffreyWay committed Jan 22, 2019
1 parent 89d8ecb commit 47adf5523b17c4993d337a0ad15f4adfcba681e8
@@ -90,9 +90,9 @@ public function update(Project $project)
protected function validateRequest()
{
return request()->validate([
'title' => 'required',
'description' => 'required',
'notes' => 'min:3'
'title' => 'sometimes|required',
'description' => 'sometimes|required',
'notes' => 'nullable'
]);
}
}
@@ -0,0 +1,7 @@
@if ($errors->any())
<div class="field mt-6">
@foreach ($errors->all() as $error)
<li class="text-sm text-red">{{ $error }}</li>
@endforeach
</div>
@endif
@@ -35,10 +35,4 @@ class="textarea bg-transparent border border-grey-light rounded p-2 text-xs w-fu
</div>
</div>

@if ($errors->any())
<div class="field mt-6">
@foreach ($errors->all() as $error)
<li class="text-sm text-red">{{ $error }}</li>
@endforeach
</div>
@endif
@include ('errors')
@@ -59,6 +59,8 @@ class="card w-full mb-4"

<button type="submit" class="button">Save</button>
</form>

@include ('errors')
</div>
</div>

@@ -63,6 +63,18 @@ function a_user_can_update_a_project()
$this->assertDatabaseHas('projects', $attributes);
}
/** @test */
function a_user_can_update_a_projects_general_notes()
{
$project = ProjectFactory::create();
$this->actingAs($project->owner)
->patch($project->path(), $attributes = ['notes' => 'Changed']);
$this->assertDatabaseHas('projects', $attributes);
}
/** @test */
public function a_user_can_view_their_project()
{

0 comments on commit 47adf55

Please sign in to comment.
You can’t perform that action at this time.