Skip to content

Commit

Permalink
Merge pull request #3363 from TakeMeNL/bugfix/3288
Browse files Browse the repository at this point in the history
Resolve #3288
  • Loading branch information
jbrooksuk committed Dec 17, 2018
2 parents a7789dc + 5f1dfc6 commit cddeac0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/ComponentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function update(Component $component)
Binput::get('link'),
Binput::get('order'),
Binput::get('group_id'),
(bool) Binput::get('enabled'),
Binput::get('enabled', $component->enabled),
Binput::get('meta', null),
(bool) Binput::get('silent', false)
));
Expand Down
7 changes: 4 additions & 3 deletions tests/Api/ComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function test_can_update_component()
]);

$response->assertStatus(200);
$response->assertJsonFragment(['name' => 'Foo']);
$response->assertJsonFragment(['name' => 'Foo', 'enabled' => $component->enabled]);
}

public function test_can_update_component_without_status_change()
Expand All @@ -190,7 +190,7 @@ public function test_can_update_component_without_status_change()
]);

$response->assertStatus(200);
$response->assertJsonFragment(['name' => 'Foo']);
$response->assertJsonFragment(['name' => 'Foo', 'enabled' => $component->enabled]);
}

public function test_can_update_component_with_status_change()
Expand All @@ -211,7 +211,7 @@ public function test_can_update_component_with_status_change()
]);

$response->assertStatus(200);
$response->assertJsonFragment(['name' => 'Foo', 'status' => 2]);
$response->assertJsonFragment(['name' => 'Foo', 'status' => 2, 'enabled' => $component->enabled]);
}

public function test_can_update_component_with_meta_data()
Expand All @@ -238,6 +238,7 @@ public function test_can_update_component_with_meta_data()
'uuid' => '172ff3fb-41f7-49d3-8bcd-f57b53627fa0',
'foo' => 'bar',
],
'enabled' => $component->enabled,
]);
}

Expand Down

0 comments on commit cddeac0

Please sign in to comment.