Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test local storage on Twitter plugin

  • Loading branch information...
commit 0e0db8f2075dc69abff432f36ba720eb1fd52042 1 parent 4c3d38a
@joshuaclayton authored
Showing with 7 additions and 1 deletion.
  1. +6 −0 jquery.twitter.tests.js
  2. +1 −1  spec.js
View
6 jquery.twitter.tests.js
@@ -3,6 +3,7 @@ var originalAjax = $.ajax;
QUnit.testDone = function() {
$.ajax = originalAjax;
$(".workspace").empty();
+ localStorage.clear();
};
function stubTwitterErrorResponse(status) {
@@ -48,6 +49,11 @@ describe("$.twitter", function() {
$.twitter.addFavorite("awesome");
$.twitter.favorites().should(include, "awesome");
});
+
+ it("should use local storage for favorites", function() {
+ $.twitter.addFavorite("awesome");
+ JSON.parse(localStorage.favorites).should(eql, ["awesome"]);
+ });
});
describe("tweetify", function() {
View
2  spec.js
@@ -59,7 +59,7 @@ var SpecIt = {
},
eql: function() {
if(SpecIt.currentExpectation === 'should') {
- equals(this,
+ same(this,
arguments[0],
"Expected " + this + " to equal " + arguments[0]);
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.