Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 6a72bded
authored
Apr 01, 2015
by
Ruben Bridgewater
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
1 parent
49efe137
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
test/integration/instance.test.js
test/integration/instance.test.js
View file @
6a72bde
...
@@ -167,12 +167,12 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
...
@@ -167,12 +167,12 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
});
});
});
});
it
(
'returns
tru
e for bulk non-changed attribute + model with timestamps'
,
function
()
{
it
(
'returns
fals
e for bulk non-changed attribute + model with timestamps'
,
function
()
{
return
this
.
User
.
create
({
username
:
'user'
}).
then
(
function
(
user
)
{
return
this
.
User
.
create
({
username
:
'user'
}).
then
(
function
(
user
)
{
user
.
setAttributes
({
user
.
setAttributes
({
username
:
'user'
username
:
'user'
});
});
expect
(
user
.
isDirty
).
to
.
be
.
tru
e
;
expect
(
user
.
isDirty
).
to
.
be
.
fals
e
;
});
});
});
});
...
@@ -289,7 +289,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
...
@@ -289,7 +289,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
it
(
'with array'
,
function
()
{
it
(
'with array'
,
function
()
{
var
self
=
this
;
var
self
=
this
;
return
this
.
User
.
find
(
1
).
then
(
function
(
err
,
user1
)
{
return
this
.
User
.
find
(
1
).
then
(
function
(
user1
)
{
return
user1
.
increment
([
'aNumber'
],
{
by
:
2
}).
then
(
function
()
{
return
user1
.
increment
([
'aNumber'
],
{
by
:
2
}).
then
(
function
()
{
return
self
.
User
.
find
(
1
).
then
(
function
(
user3
)
{
return
self
.
User
.
find
(
1
).
then
(
function
(
user3
)
{
expect
(
user3
.
aNumber
).
to
.
be
.
equal
(
2
);
expect
(
user3
.
aNumber
).
to
.
be
.
equal
(
2
);
...
@@ -500,7 +500,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
...
@@ -500,7 +500,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
return
User
.
sync
({
force
:
true
}).
then
(
function
()
{
return
User
.
sync
({
force
:
true
}).
then
(
function
()
{
return
User
.
create
({
aNumber
:
1
}).
then
(
function
(
user
)
{
return
User
.
create
({
aNumber
:
1
}).
then
(
function
(
user
)
{
var
oldDate
=
user
.
updatedAt
;
var
oldDate
=
user
.
updatedAt
;
return
this
.
sequelize
.
Promise
.
de
p
lay
(
1000
).
then
(
function
()
{
return
this
.
sequelize
.
Promise
.
delay
(
1000
).
then
(
function
()
{
return
user
.
decrement
(
'aNumber'
,
{
by
:
1
}).
then
(
function
()
{
return
user
.
decrement
(
'aNumber'
,
{
by
:
1
}).
then
(
function
()
{
return
User
.
find
(
1
).
then
(
function
(
user
)
{
return
User
.
find
(
1
).
then
(
function
(
user
)
{
expect
(
user
.
updatedAt
).
to
.
be
.
afterTime
(
oldDate
);
expect
(
user
.
updatedAt
).
to
.
be
.
afterTime
(
oldDate
);
...
@@ -1039,7 +1039,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
...
@@ -1039,7 +1039,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
,
User
=
this
.
User
;
,
User
=
this
.
User
;
// timeout is needed, in order to check the update of the timestamp
// timeout is needed, in order to check the update of the timestamp
return
this
.
sequelize
.
Promise
.
de
p
lay
(
1000
).
then
(
function
()
{
return
this
.
sequelize
.
Promise
.
delay
(
1000
).
then
(
function
()
{
user
=
User
.
build
({
username
:
'user'
});
user
=
User
.
build
({
username
:
'user'
});
return
user
.
save
().
then
(
function
()
{
return
user
.
save
().
then
(
function
()
{
expect
(
now
).
to
.
be
.
below
(
user
.
updatedAt
.
getTime
());
expect
(
now
).
to
.
be
.
below
(
user
.
updatedAt
.
getTime
());
...
@@ -1380,10 +1380,10 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
...
@@ -1380,10 +1380,10 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
});
});
});
});
it
(
"dont return instance that isn't defined"
,
function
(
done
)
{
it
(
"dont return instance that isn't defined"
,
function
()
{
var
self
=
this
;
var
self
=
this
;
return
self
.
Project
.
create
({
lovelyUserId
:
null
})
return
self
.
Project
.
create
({
lovelyUserId
:
null
})
.
then
(
function
(
project
)
{
.
then
(
function
(
project
)
{
return
self
.
Project
.
find
({
return
self
.
Project
.
find
({
where
:
{
where
:
{
id
:
project
.
id
id
:
project
.
id
...
@@ -1393,16 +1393,16 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
...
@@ -1393,16 +1393,16 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
]
]
});
});
})
})
.
then
(
function
(
project
)
{
.
then
(
function
(
project
)
{
var
json
=
project
.
toJSON
();
var
json
=
project
.
toJSON
();
expect
(
json
.
LovelyUser
).
to
.
be
.
equal
(
null
);
expect
(
json
.
LovelyUser
).
to
.
be
.
equal
(
null
);
});
});
});
});
it
(
"dont return instances that aren't defined"
,
function
(
done
)
{
it
(
"dont return instances that aren't defined"
,
function
()
{
var
self
=
this
;
var
self
=
this
;
return
self
.
User
.
create
({
username
:
'cuss'
})
return
self
.
User
.
create
({
username
:
'cuss'
})
.
then
(
function
(
user
)
{
.
then
(
function
(
user
)
{
return
self
.
User
.
find
({
return
self
.
User
.
find
({
where
:
{
where
:
{
id
:
user
.
id
id
:
user
.
id
...
@@ -1412,7 +1412,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
...
@@ -1412,7 +1412,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
]
]
});
});
})
})
.
then
(
function
(
user
)
{
.
then
(
function
(
user
)
{
var
json
=
user
.
toJSON
();
var
json
=
user
.
toJSON
();
expect
(
user
.
Projects
).
to
.
be
.
instanceof
(
Array
);
expect
(
user
.
Projects
).
to
.
be
.
instanceof
(
Array
);
expect
(
user
.
Projects
).
to
.
be
.
length
(
0
);
expect
(
user
.
Projects
).
to
.
be
.
length
(
0
);
...
@@ -1468,7 +1468,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
...
@@ -1468,7 +1468,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
return
this
.
ParanoidUser
.
sync
({
force
:
true
});
return
this
.
ParanoidUser
.
sync
({
force
:
true
});
});
});
it
(
'sql should have paranoid condition'
,
function
(
done
)
{
it
(
'sql should have paranoid condition'
,
function
()
{
var
self
=
this
;
var
self
=
this
;
return
self
.
ParanoidUser
.
create
({
username
:
'cuss'
})
return
self
.
ParanoidUser
.
create
({
username
:
'cuss'
})
.
then
(
function
()
{
.
then
(
function
()
{
...
@@ -1486,7 +1486,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
...
@@ -1486,7 +1486,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
});
});
});
});
it
(
'sequelize.and as where should include paranoid condition'
,
function
(
done
)
{
it
(
'sequelize.and as where should include paranoid condition'
,
function
()
{
var
self
=
this
;
var
self
=
this
;
return
self
.
ParanoidUser
.
create
({
username
:
'cuss'
})
return
self
.
ParanoidUser
.
create
({
username
:
'cuss'
})
.
then
(
function
()
{
.
then
(
function
()
{
...
@@ -1512,7 +1512,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
...
@@ -1512,7 +1512,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
});
});
});
});
it
(
'sequelize.or as where should include paranoid condition'
,
function
(
done
)
{
it
(
'sequelize.or as where should include paranoid condition'
,
function
()
{
var
self
=
this
;
var
self
=
this
;
return
self
.
ParanoidUser
.
create
({
username
:
'cuss'
})
return
self
.
ParanoidUser
.
create
({
username
:
'cuss'
})
.
then
(
function
()
{
.
then
(
function
()
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment