Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
rivets
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
885b6848
authored
2012-08-05 18:02:17 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update binding spec to adhere to the new formatters API.
1 parent
bac6233c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
spec/rivets/binding.js
spec/rivets/binding.js
View file @
885b684
...
...
@@ -78,9 +78,7 @@ describe('Rivets.Binding', function() {
});
it
(
'applies any formatters to the value before performing the routine'
,
function
()
{
rivets
.
config
.
formatters
=
{
awesome
:
function
(
value
)
{
return
'awesome '
+
value
}
};
rivets
.
formatters
.
awesome
=
function
(
value
)
{
return
'awesome '
+
value
};
binding
.
formatters
.
push
(
'awesome'
);
spyOn
(
binding
,
'routine'
);
binding
.
set
(
'sweater'
);
...
...
@@ -133,9 +131,7 @@ describe('Rivets.Binding', function() {
describe
(
'formattedValue()'
,
function
()
{
it
(
'applies the current formatters on the supplied value'
,
function
()
{
rivets
.
config
.
formatters
=
{
awesome
:
function
(
value
)
{
return
'awesome '
+
value
}
};
rivets
.
formatters
.
awesome
=
function
(
value
)
{
return
'awesome '
+
value
};
binding
.
formatters
.
push
(
'awesome'
);
expect
(
binding
.
formattedValue
(
'hat'
)).
toBe
(
'awesome hat'
);
});
...
...
@@ -148,10 +144,8 @@ describe('Rivets.Binding', function() {
describe
(
'with a multi-argument formatter string'
,
function
()
{
beforeEach
(
function
()
{
rivets
.
config
.
formatters
=
{
awesome
:
function
(
value
,
prefix
)
{
rivets
.
formatters
.
awesome
=
function
(
value
,
prefix
)
{
return
prefix
+
' awesome '
+
value
;
}
};
binding
.
formatters
.
push
(
'awesome super'
);
});
...
...
Please
register
or
sign in
to post a comment