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 09437fbe
authored
Jun 11, 2014
by
Matthew Ohlman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for bugfix
1 parent
d30e1dc2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
test/model/attributes.test.js
test/model/attributes.test.js
View file @
09437fb
...
...
@@ -63,6 +63,10 @@ describe(Support.getTestDialectTeaser("Model"), function () {
text
:
{
type
:
DataTypes
.
STRING
,
field
:
'comment_text'
},
notes
:
{
type
:
DataTypes
.
STRING
,
field
:
'notes'
}
},
{
tableName
:
'comments'
,
...
...
@@ -120,6 +124,9 @@ describe(Support.getTestDialectTeaser("Model"), function () {
},
comment_text
:
{
type
:
DataTypes
.
STRING
},
notes
:
{
type
:
DataTypes
.
STRING
}
})
]);
...
...
@@ -247,6 +254,30 @@ describe(Support.getTestDialectTeaser("Model"), function () {
});
});
});
it
(
'field names that are the same as property names should create, update, and read correctly'
,
function
()
{
var
self
=
this
;
return
this
.
Comment
.
create
({
notes
:
'Foobar'
}).
then
(
function
()
{
return
self
.
Comment
.
find
({
limit
:
1
});
}).
then
(
function
(
comment
)
{
expect
(
comment
.
get
(
'notes'
)).
to
.
equal
(
'Foobar'
);
return
comment
.
updateAttributes
({
notes
:
'Barfoo'
});
}).
then
(
function
()
{
return
self
.
Comment
.
find
({
limit
:
1
});
}).
then
(
function
(
comment
)
{
expect
(
comment
.
get
(
'notes'
)).
to
.
equal
(
'Barfoo'
);
});
});
});
describe
(
'types'
,
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