-
-
Save jbpapp/e49a5ba2ad337c34eaf5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @test */ | |
public function it_creates_a_new_partner_given_valid_parameters() | |
{ | |
$this->getJson('api/v1/partners', 'POST', $this->getStub()); | |
$this->assertResponseStatus(201); | |
} | |
// stub | |
[ | |
'name' => 'Company name', | |
'meta' => [ | |
'location' => 'San Fransisco', | |
'employees' => 100, | |
'contract_period' => 5 | |
] | |
] | |
// as a PartnersControllerben: | |
$partner = $this->partner->create(array_only($input, 'name')); | |
$this->partner_meta->saveMeta(array_except($input, 'name')); | |
// Persze ehhez at kell irni a method-ot, ami elmenti a meta adatokat, mert most az inputon belul egy meta tombbe lesz benen minden |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment