Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
laravel-adminpanel
Commits
f7708440
Commit
f7708440
authored
Dec 26, 2017
by
Viral Solani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test cases for Logged in route test
parent
1a5aa284
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
composer.json
composer.json
+2
-0
LoggedInRouteTest.php
tests/Feature/Frontend/LoggedInRouteTest.php
+60
-0
No files found.
composer.json
View file @
f7708440
...
...
@@ -5,6 +5,8 @@
"framework"
,
"laravel"
,
"boilerplate"
"adminpanel"
"rest-api"
],
"license"
:
"MIT"
,
"type"
:
"project"
,
...
...
tests/Feature/Frontend/LoggedInRouteTest.php
0 → 100644
View file @
f7708440
<?php
namespace
Tests\Feature\Frontend
;
use
Tests\BrowserKitTestCase
;
use
Illuminate\Support\Facades\Event
;
use
App\Events\Frontend\Auth\UserLoggedOut
;
/**
* Class LoggedInRouteTest.
*/
class
LoggedInRouteTest
extends
BrowserKitTestCase
{
/**
* Test the homepage works and the dashboard button appears.
*/
public
function
testHomePageLoggedIn
()
{
$this
->
actingAs
(
$this
->
user
)
->
visit
(
'/'
)
->
see
(
'Dashboard'
)
->
see
(
$this
->
user
->
name
)
->
dontSee
(
'Administration'
);
}
/**
* Test the dashboard page works and displays the users information.
*/
/** @test */
public
function
dashboard_page_loads_properly
()
{
$this
->
actingAs
(
$this
->
user
)
->
visit
(
'/dashboard'
)
->
see
(
$this
->
user
->
email
)
->
see
(
'Joined'
)
->
dontSee
(
'Administration'
);
}
/**
* Test the account page works and displays the users information.
*/
/** @test */
public
function
account_page_loads_properly
()
{
$this
->
actingAs
(
$this
->
user
)
->
visit
(
'/account'
)
->
see
(
'My Account'
)
->
see
(
'Profile'
)
->
see
(
'Update Information'
)
->
see
(
'Change Password'
)
->
dontSee
(
'Administration'
);
}
/** @test */
public
function
users_can_logout
()
{
// Make sure our events are fired
Event
::
fake
();
$this
->
actingAs
(
$this
->
user
)
->
visit
(
'/logout'
)
->
see
(
'Login'
)
->
see
(
'Register'
);
Event
::
assertDispatched
(
UserLoggedOut
::
class
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment