Skip to content

Commit

Permalink
Fix tests from a098ff4 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jammus committed Feb 9, 2013
1 parent a098ff4 commit 3dc18c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
4 changes: 3 additions & 1 deletion tests/TestData.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 2 additions & 12 deletions tests/party-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,27 +132,17 @@ describe("A party in full swing");
stream.emit("scrobbled", FakeTracks.RunToYourGrave);
});

it("takes timestamp from time track started playing", function() {
it("takes timestamp from track", function() {
count = 1;
gently.expect(lastfm, "info");
stream.emit("nowPlaying", FakeTracks.RunToYourGrave);
var timestamp = Math.round((new Date).getTime() / 1000);
gently.expect(lastfm, "update", 2, function(method, session, options) {
assert.equal(timestamp, options.timestamp);
assert.equal(FakeTracks.RunToYourGrave.date.uts, options.timestamp);
count++;
});
stream.emit("scrobbled", FakeTracks.RunToYourGrave);
});

it("if no nowPlaying update then timestamp is current time", function() {
count = 1;
var timestamp = Math.round((new Date).getTime() / 1000);
gently.expect(lastfm, "update", 2, function(method, session, options) {
assert.equal(timestamp, options.timestamp);
count++;
});
stream.emit("scrobbled", FakeTracks.RunToYourGrave);
});
it("doesn't share nowPlaying updates with guests after they leave", function() {
gently.expect(lastfm, "update", 1);
party.removeGuest(guestTwo);
Expand Down

0 comments on commit 3dc18c2

Please sign in to comment.