Revision 6528,
1.5 KB
checked in by gustavo, 12 years ago
(diff) |
Ticket #2766 - Merge do branch das novas funcionalidaes para o trunk
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[6512] | 1 | <!DOCTYPE html> |
---|
| 2 | |
---|
| 3 | <html> |
---|
| 4 | <head> |
---|
| 5 | <title>jQuery Test Runner</title> |
---|
| 6 | |
---|
| 7 | <link rel="stylesheet" type="text/css" href="lib/jasmine.css"> |
---|
| 8 | |
---|
| 9 | <script type="text/javascript" charset="utf-8" src="../js/jquery.min.js"></script> |
---|
| 10 | <script type="text/javascript" charset="utf-8" src="../js/jquery.raty.js"></script> |
---|
| 11 | |
---|
| 12 | <script type="text/javascript" charset="utf-8" src="lib/jasmine.js"></script> |
---|
| 13 | <script type="text/javascript" charset="utf-8" src="lib/jasmine-html.js"></script> |
---|
| 14 | <script type="text/javascript" charset="utf-8" src="lib/jasmine-jquery.js"></script> |
---|
| 15 | </head> |
---|
| 16 | <body> |
---|
| 17 | <script type="text/javascript"> |
---|
| 18 | describe('', function() { |
---|
| 19 | |
---|
| 20 | beforeEach(function() { |
---|
| 21 | $('body').append('<div id="star"></div><div class="star">1</div><div class="star">2</div><div class="star">3</div>'); |
---|
| 22 | }); |
---|
| 23 | |
---|
| 24 | it ('[score / readOnly] should not set score when it is read-only', function() { |
---|
| 25 | // given |
---|
| 26 | var star = $('#star').raty({ readOnly: true }); |
---|
| 27 | |
---|
| 28 | // when |
---|
| 29 | star.raty('score', 1); |
---|
| 30 | |
---|
| 31 | // then |
---|
| 32 | var imgs = star.children('img'); |
---|
| 33 | |
---|
| 34 | expect(imgs.eq(0)).toHaveAttr('src', 'img/star-off.png'); |
---|
| 35 | expect(imgs.eq(1)).toHaveAttr('src', 'img/star-off.png'); |
---|
| 36 | expect(imgs.eq(2)).toHaveAttr('src', 'img/star-off.png'); |
---|
| 37 | expect(imgs.eq(3)).toHaveAttr('src', 'img/star-off.png'); |
---|
| 38 | expect(imgs.eq(4)).toHaveAttr('src', 'img/star-off.png'); |
---|
| 39 | }); |
---|
| 40 | |
---|
| 41 | }); |
---|
| 42 | |
---|
| 43 | jasmine.getEnv().addReporter(new jasmine.TrivialReporter()); |
---|
| 44 | jasmine.getEnv().execute(); |
---|
| 45 | </script> |
---|
| 46 | </body> |
---|
| 47 | </html> |
---|
Note: See
TracBrowser
for help on using the repository browser.