Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** @test */
- public function a_job_can_be_stored_in_database()
- {
- $this->withoutExceptionHandling();
- $company = factory('AppCompany')->create();
- $job = factory('AppJob')->make([
- 'description' => 'we are looking for cheff helper'
- ]);
- $this->post(route('jobs.store'), $job->toArray());
- $this->assertDatabaseHas('jobs', [
- 'description' => 'we are looking for cheff helper'
- ]);
- }
- public function store(Company $company)
- {
- $company->addJob([
- 'city_id' => request('city_id'),
- 'title' => request('title'),
- 'description' => request('description'),
- 'requirements' => request('requirements'),
- 'salary' => request('salary'),
- 'address' => request('address')
- ]);
- return redirect(route('jobs.index'));
- }
- public function addJob($data)
- {
- return $this->jobs()->create($data);
- }
- TestsFeatureJobFeatureTest::a_job_can_be_stored_in_database
- public function temporalTest()
- {
- $this->withoutExceptionHandling();
- $song = factory('AppSong')->make(['name' => 'charlie']);
- $this->post(route('songs.store', $song->artist_id), $song->toArray());
- $this->assertDatabaseHas('songs',[
- 'name' => 'charlie'
- ]);
- }
Add Comment
Please, Sign In to add comment