Add Intel copyright header.
[profile/ivi/cowhide.git] / examples / hoofbeats / tests / unit / resolvers / musicbrainz.js
1 /* vi: set et sw=4 ts=4 si: */
2 /*
3  * Copyright (c) 2012, Intel Corporation.
4  *
5  * This program is licensed under the terms and conditions of the
6  * Apache License, version 2.0.  The full text of the Apache License is at
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  */
10
11 $(function() {
12     module("hoofbeats-musicbrainz", {
13         setup: function() {
14         },
15         teardown: function() {
16         }
17     });
18
19     test("get artist data",
20     function() {
21         var name = "Regina Spektor";
22         var promise = MusicBrainz.getArtist(name);
23         stop();
24         promise.done(function(data) {
25             equals(data.name, name, "name matches");
26             start();
27         });
28     });
29
30     test("get artist data, artist not found",
31     function() {
32         var name = "This artist does not exist";
33         var promise = MusicBrainz.getArtist(name);
34         stop();
35         promise.fail(function() {
36             equals(1, 1, "the method failed");
37             start();
38         });
39     });
40 });