Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
ulakbus
ulakbus-ui
Commits
b311140e
Commit
b311140e
authored
Jul 01, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
login olduktan sonra redirect senaryosu testi eklendi (expect)
kullanılmayanlar temizlendi
parent
6490a67e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
auth_test.js
app/components/auth/auth_test.js
+9
-7
No files found.
app/components/auth/auth_test.js
View file @
b311140e
...
@@ -55,22 +55,24 @@ describe('zaerp.auth module', function () {
...
@@ -55,22 +55,24 @@ describe('zaerp.auth module', function () {
);
);
it
(
'ensures user can log in'
,
function
()
{
it
(
'ensures user can log in'
,
function
()
{
// expect current scope to contain username
// todo: after backend api ready implement this
});
it
(
'ensures path has changed'
,
function
()
{
// expect path to equal '/dashboard'
});
});
it
(
'should get login success'
,
it
(
'should get login success'
,
inject
(
function
(
LoginService
,
$httpBackend
)
{
inject
(
function
(
LoginService
,
$httpBackend
,
$location
)
{
// use httpBackend to imitate login api
$httpBackend
.
expectGET
(
'http://127.0.0.1:8000/login?email=test@test.com&password=password&'
)
$httpBackend
.
expectGET
(
'http://127.0.0.1:3000/api/login?email=test@test.com&password=password&'
)
.
respond
(
204
,
{
'id'
:
1
,
'user'
:
{
'id'
:
12
,
'role'
:
'admin'
}});
// todo: with real api change response data from list to obj
.
respond
(
200
,
[{
'id'
:
1
,
'user'
:
{
'id'
:
12
,
'role'
:
'admin'
},
'success'
:
true
}]);
var
cred
=
{
email
:
'test@test.com'
,
password
:
'password'
};
var
cred
=
{
email
:
'test@test.com'
,
password
:
'password'
};
LoginService
.
login
(
cred
)
LoginService
.
login
(
cred
)
.
then
(
function
(
data
)
{
.
then
(
function
(
data
)
{
expect
(
data
).
not
.
toBe
(
null
);
expect
(
data
).
not
.
toBe
(
null
);
// after login path need to be change dashboard
expect
(
$location
.
path
()).
toBe
(
'/dashboard'
);
});
});
$httpBackend
.
flush
();
$httpBackend
.
flush
();
...
...
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