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
064db165
authored
2012-07-17 23:51:30 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add initial set of isolated unit tests for the binding routines.
1 parent
ddeb06ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
spec/rivets.js
spec/rivets.js
View file @
064db16
...
...
@@ -50,6 +50,31 @@ describe('Rivets', function() {
});
});
describe
(
'Routines'
,
function
()
{
describe
(
'text'
,
function
()
{
it
(
"sets the element's text content"
,
function
()
{
rivets
.
routines
.
text
(
el
,
'<em>gluten-free</em>'
);
expect
(
el
.
textContent
||
el
.
innerText
).
toBe
(
'<em>gluten-free</em>'
);
expect
(
el
.
innerHTML
).
toBe
(
'<em>gluten-free</em>'
);
});
});
describe
(
'html'
,
function
()
{
it
(
"sets the element's HTML content"
,
function
()
{
rivets
.
routines
.
html
(
el
,
'<strong>fixie</strong>'
);
expect
(
el
.
textContent
||
el
.
innerText
).
toBe
(
'fixie'
);
expect
(
el
.
innerHTML
).
toBe
(
'<strong>fixie</strong>'
);
});
});
describe
(
'value'
,
function
()
{
it
(
"sets the element's value"
,
function
()
{
rivets
.
routines
.
value
(
input
,
'pitchfork'
);
expect
(
input
.
value
).
toBe
(
'pitchfork'
);
});
});
});
describe
(
'Binds'
,
function
()
{
describe
(
'Text'
,
function
()
{
it
(
'should set the text content of the element'
,
function
()
{
...
...
Please
register
or
sign in
to post a comment