Restricture musicbrainz.js.
[profile/ivi/cowhide.git] / examples / hoofbeats / tests / unit / musicbrainz.js
1 /* vi: set et sw=4 ts=4 si: */
2 $(function() {
3     module("hoofbeats-musicbrainz", {
4         setup: function() {
5         },
6         teardown: function() {
7         }
8     });
9
10     test("get artist data",
11     function() {
12         var name = "Regina Spektor";
13         var promise = MusicBrainz.getArtist(name);
14         stop();
15         promise.done(function(data) {
16             equals(data.name, name, "name matches");
17             start();
18         });
19     });
20
21     test("get artist data, artist not found",
22     function() {
23         var name = "This artist does not exist";
24         var promise = MusicBrainz.getArtist(name);
25         stop();
26         promise.fail(function() {
27             equals(1, 1, "the method failed");
28             start();
29         });
30     });
31 });