-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Organiser Events Test fixed model factory
- Loading branch information
bretto36
committed
Jun 17, 2016
1 parent
adf16e7
commit ea5d4fa
Showing
9 changed files
with
63 additions
and
25 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
|
||
class OrganiserEventsController extends MyBaseController | ||
{ | ||
|
||
/** | ||
* Show the organiser events page | ||
* | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
|
||
class OrganiserViewController extends Controller | ||
{ | ||
|
||
/** | ||
* Show the public organiser page | ||
* | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
use Illuminate\Foundation\Testing\WithoutMiddleware; | ||
use Illuminate\Foundation\Testing\DatabaseMigrations; | ||
use Illuminate\Foundation\Testing\DatabaseTransactions; | ||
use App\Models\Organiser; | ||
|
||
class OrganiserCustomizeTest extends TestCase | ||
{ | ||
public function test_customize_organiser_is_successful() | ||
{ | ||
$organiser = factory(App\Models\Organiser::class)->create(); | ||
|
||
$this->actingAs($this->test_user) | ||
->visit(route('showOrganiserCustomize', ['organiser_id' => $organiser->id])) | ||
->type($this->faker->name, 'name') | ||
->type($this->faker->email, 'email') | ||
->type($this->faker->email, 'about') | ||
->type($this->faker->word, 'facebook') | ||
->type($this->faker->word, 'twitter') | ||
->press('Create Organiser') | ||
->seeJson([ | ||
'status' => 'success' | ||
]); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
use Illuminate\Foundation\Testing\WithoutMiddleware; | ||
use Illuminate\Foundation\Testing\DatabaseMigrations; | ||
use Illuminate\Foundation\Testing\DatabaseTransactions; | ||
use App\Models\Organiser; | ||
|
||
class OrganiserEventsTest extends TestCase | ||
{ | ||
public function test_show_events_displays_events() | ||
{ | ||
$organiser = factory(App\Models\Organiser::class)->create(['account_id' => 1]); | ||
|
||
$event1 = factory(App\Models\Event::class)->create([ | ||
'account_id' => $organiser->account_id, | ||
'organiser_id' => $organiser->id, | ||
'user_id' => $this->test_user->id, | ||
]); | ||
|
||
$event2 = factory(App\Models\Event::class)->create([ | ||
'account_id' => $organiser->account_id, | ||
'organiser_id' => $organiser->id, | ||
'user_id' => $this->test_user->id, | ||
]); | ||
|
||
$this->actingAs($this->test_user) | ||
->visit(route('showOrganiserEvents', ['organiser_id' => $organiser->id])) | ||
->see($event1->title) | ||
->see($event2->title) | ||
->see('2 events'); | ||
} | ||
} |
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
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