Permalink
Browse files

MINOR Added sapphire/thirdparty/jasmine for javascript testing

  • Loading branch information...
1 parent e78b700 commit b5d2e10d41d278e8ca66c27925c3e7915f9c6ace @chillu chillu committed Mar 2, 2011
Showing with 26,122 additions and 0 deletions.
  1. +8 −0 thirdparty/jasmine-ajax/.piston.yml
  2. +20 −0 thirdparty/jasmine-ajax/MIT.LICENSE
  3. +16 −0 thirdparty/jasmine-ajax/README.markdown
  4. +3 −0 thirdparty/jasmine-ajax/Rakefile
  5. +2 −0 thirdparty/jasmine-ajax/examples/jquery/Rakefile
  6. +59 −0 thirdparty/jasmine-ajax/examples/jquery/public/css/master.css
  7. +47 −0 thirdparty/jasmine-ajax/examples/jquery/public/css/reset.css
  8. BIN thirdparty/jasmine-ajax/examples/jquery/public/images/fail-whale.png
  9. +60 −0 thirdparty/jasmine-ajax/examples/jquery/public/index.html
  10. +6 −0 thirdparty/jasmine-ajax/examples/jquery/public/javascripts/Tweet.js
  11. +32 −0 thirdparty/jasmine-ajax/examples/jquery/public/javascripts/TwitSearch.js
  12. +31 −0 thirdparty/jasmine-ajax/examples/jquery/public/javascripts/TwitterApi.js
  13. +32 −0 thirdparty/jasmine-ajax/examples/jquery/spec/SpecRunner.html
  14. +24 −0 thirdparty/jasmine-ajax/examples/jquery/spec/javascripts/TweetSpec.js
  15. +86 −0 thirdparty/jasmine-ajax/examples/jquery/spec/javascripts/TwitterApiSpec.js
  16. +16 −0 thirdparty/jasmine-ajax/examples/jquery/spec/javascripts/helpers/test_responses/search.js
  17. +3 −0 thirdparty/jasmine-ajax/examples/jquery/spec/javascripts/helpers/tweets.js
  18. +182 −0 thirdparty/jasmine-ajax/examples/jquery/spec/javascripts/jasmine-0.11.1/jasmine-html.js
  19. +166 −0 thirdparty/jasmine-ajax/examples/jquery/spec/javascripts/jasmine-0.11.1/jasmine.css
  20. +2,343 −0 thirdparty/jasmine-ajax/examples/jquery/spec/javascripts/jasmine-0.11.1/jasmine.js
  21. +78 −0 thirdparty/jasmine-ajax/examples/jquery/spec/javascripts/support/jasmine.yml
  22. +21 −0 thirdparty/jasmine-ajax/examples/jquery/spec/javascripts/support/jasmine_runner.rb
  23. +2 −0 thirdparty/jasmine-ajax/examples/prototype/Rakefile
  24. +59 −0 thirdparty/jasmine-ajax/examples/prototype/public/css/master.css
  25. +47 −0 thirdparty/jasmine-ajax/examples/prototype/public/css/reset.css
  26. BIN thirdparty/jasmine-ajax/examples/prototype/public/images/fail-whale.png
  27. +45 −0 thirdparty/jasmine-ajax/examples/prototype/public/index.html
  28. +6 −0 thirdparty/jasmine-ajax/examples/prototype/public/javascripts/Tweet.js
  29. +32 −0 thirdparty/jasmine-ajax/examples/prototype/public/javascripts/TwitSearch.js
  30. +24 −0 thirdparty/jasmine-ajax/examples/prototype/public/javascripts/TwitterApi.js
  31. +32 −0 thirdparty/jasmine-ajax/examples/prototype/spec/SpecRunner.html
  32. +24 −0 thirdparty/jasmine-ajax/examples/prototype/spec/javascripts/TweetSpec.js
  33. +87 −0 thirdparty/jasmine-ajax/examples/prototype/spec/javascripts/TwitterApiSpec.js
  34. +16 −0 thirdparty/jasmine-ajax/examples/prototype/spec/javascripts/helpers/test_responses/search.js
  35. +3 −0 thirdparty/jasmine-ajax/examples/prototype/spec/javascripts/helpers/tweets.js
  36. +182 −0 thirdparty/jasmine-ajax/examples/prototype/spec/javascripts/jasmine-0.11.1/jasmine-html.js
  37. +166 −0 thirdparty/jasmine-ajax/examples/prototype/spec/javascripts/jasmine-0.11.1/jasmine.css
  38. +2,343 −0 thirdparty/jasmine-ajax/examples/prototype/spec/javascripts/jasmine-0.11.1/jasmine.js
  39. +78 −0 thirdparty/jasmine-ajax/examples/prototype/spec/javascripts/support/jasmine.yml
  40. +21 −0 thirdparty/jasmine-ajax/examples/prototype/spec/javascripts/support/jasmine_runner.rb
  41. +154 −0 thirdparty/jasmine-ajax/frameworks/jquery.js
  42. +4,874 −0 thirdparty/jasmine-ajax/frameworks/prototype.js
  43. +114 −0 thirdparty/jasmine-ajax/lib/mock-ajax.js
  44. +19 −0 thirdparty/jasmine-ajax/lib/spec-helper.js
  45. +38 −0 thirdparty/jasmine-ajax/spec/javascripts/fake-xml-http-request-spec.js
  46. +15 −0 thirdparty/jasmine-ajax/spec/javascripts/helpers/spec-helper.js
  47. +328 −0 thirdparty/jasmine-ajax/spec/javascripts/mock-ajax-jquery-spec.js
  48. +279 −0 thirdparty/jasmine-ajax/spec/javascripts/mock-ajax-prototypejs-spec.js
  49. +81 −0 thirdparty/jasmine-ajax/spec/javascripts/support/jasmine.yml
  50. +21 −0 thirdparty/jasmine-ajax/spec/javascripts/support/jasmine_runner.rb
  51. +8 −0 thirdparty/jasmine-dom/.piston.yml
  52. +21 −0 thirdparty/jasmine-dom/LICENSE
  53. +169 −0 thirdparty/jasmine-dom/README.markdown
  54. BIN thirdparty/jasmine-dom/lib/.DS_Store
  55. +166 −0 thirdparty/jasmine-dom/lib/jasmine-dom-fixtures.js
  56. +205 −0 thirdparty/jasmine-dom/lib/jasmine-dom-matchers.js
  57. +2 −0 thirdparty/jasmine-dom/spec/fixture.html
  58. +39 −0 thirdparty/jasmine-dom/spec/jasmine-dom-runner.html
  59. +565 −0 thirdparty/jasmine-dom/spec/suites/jasmine-dom_spec.js
  60. +7 −0 thirdparty/jasmine-dom/spec/suites/jasmine-fixture_spec.js
  61. +8 −0 thirdparty/jasmine-jquery/.piston.yml
  62. +20 −0 thirdparty/jasmine-jquery/MIT.LICENSE
  63. +152 −0 thirdparty/jasmine-jquery/README.markdown
  64. +24 −0 thirdparty/jasmine-jquery/SpecRunner.html
  65. +254 −0 thirdparty/jasmine-jquery/lib/jasmine-jquery.js
  66. +576 −0 thirdparty/jasmine-jquery/spec/suites/jasmine-jquery-spec.js
  67. +6 −0 thirdparty/jasmine/.gitignore
  68. +3 −0 thirdparty/jasmine/.gitmodules
  69. +6 −0 thirdparty/jasmine/Gemfile
  70. +20 −0 thirdparty/jasmine/MIT.LICENSE
  71. +28 −0 thirdparty/jasmine/README.markdown
  72. +182 −0 thirdparty/jasmine/Rakefile
  73. +21 −0 thirdparty/jasmine/cruise_config.rb
  74. +27 −0 thirdparty/jasmine/example/SpecRunner.html
  75. +58 −0 thirdparty/jasmine/example/spec/PlayerSpec.js
  76. +9 −0 thirdparty/jasmine/example/spec/SpecHelper.js
  77. +22 −0 thirdparty/jasmine/example/src/Player.js
  78. +7 −0 thirdparty/jasmine/example/src/Song.js
  79. BIN thirdparty/jasmine/images/fail-16.png
  80. BIN thirdparty/jasmine/images/fail.png
  81. BIN thirdparty/jasmine/images/go-16.png
  82. BIN thirdparty/jasmine/images/go.png
  83. BIN thirdparty/jasmine/images/pending-16.png
  84. BIN thirdparty/jasmine/images/pending.png
  85. BIN thirdparty/jasmine/images/question-bk.png
  86. BIN thirdparty/jasmine/images/questionbk-16.png
  87. BIN thirdparty/jasmine/images/spinner.gif
  88. +17 −0 thirdparty/jasmine/jsdoc-template/allclasses.tmpl
  89. +56 −0 thirdparty/jasmine/jsdoc-template/allfiles.tmpl
  90. +646 −0 thirdparty/jasmine/jsdoc-template/class.tmpl
  91. +39 −0 thirdparty/jasmine/jsdoc-template/index.tmpl
  92. +184 −0 thirdparty/jasmine/jsdoc-template/publish.js
  93. +162 −0 thirdparty/jasmine/jsdoc-template/static/default.css
  94. +2 −0 thirdparty/jasmine/jsdoc-template/static/header.html
  95. +19 −0 thirdparty/jasmine/jsdoc-template/static/index.html
  96. +35 −0 thirdparty/jasmine/jsdoc-template/symbol.tmpl
  97. +188 −0 thirdparty/jasmine/lib/jasmine-html.js
  98. +166 −0 thirdparty/jasmine/lib/jasmine.css
  99. +2,421 −0 thirdparty/jasmine/lib/jasmine.js
  100. +478 −0 thirdparty/jasmine/lib/json2.js
  101. +80 −0 thirdparty/jasmine/spec/runner.html
  102. +27 −0 thirdparty/jasmine/spec/suites/BaseSpec.js
  103. +97 −0 thirdparty/jasmine/spec/suites/CustomMatchersSpec.js
  104. +158 −0 thirdparty/jasmine/spec/suites/EnvSpec.js
  105. +107 −0 thirdparty/jasmine/spec/suites/ExceptionsSpec.js
  106. +103 −0 thirdparty/jasmine/spec/suites/JsApiReporterSpec.js
  107. +795 −0 thirdparty/jasmine/spec/suites/MatchersSpec.js
  108. +38 −0 thirdparty/jasmine/spec/suites/MockClockSpec.js
  109. +45 −0 thirdparty/jasmine/spec/suites/MultiReporterSpec.js
  110. +54 −0 thirdparty/jasmine/spec/suites/NestedResultsSpec.js
  111. +93 −0 thirdparty/jasmine/spec/suites/PrettyPrintSpec.js
  112. +23 −0 thirdparty/jasmine/spec/suites/QueueSpec.js
  113. +56 −0 thirdparty/jasmine/spec/suites/ReporterSpec.js
  114. +267 −0 thirdparty/jasmine/spec/suites/RunnerSpec.js
  115. +1,253 −0 thirdparty/jasmine/spec/suites/SpecRunningSpec.js
  116. +124 −0 thirdparty/jasmine/spec/suites/SpecSpec.js
  117. +201 −0 thirdparty/jasmine/spec/suites/SpySpec.js
  118. +120 −0 thirdparty/jasmine/spec/suites/SuiteSpec.js
  119. +238 −0 thirdparty/jasmine/spec/suites/TrivialReporterSpec.js
  120. +40 −0 thirdparty/jasmine/spec/suites/UtilSpec.js
  121. +87 −0 thirdparty/jasmine/spec/suites/WaitsForBlockSpec.js
  122. +22 −0 thirdparty/jasmine/src/Block.js
  123. +264 −0 thirdparty/jasmine/src/Env.js
  124. +102 −0 thirdparty/jasmine/src/JsApiReporter.js
  125. +354 −0 thirdparty/jasmine/src/Matchers.js
  126. +35 −0 thirdparty/jasmine/src/MultiReporter.js
  127. +80 −0 thirdparty/jasmine/src/NestedResults.js
  128. +122 −0 thirdparty/jasmine/src/PrettyPrinter.js
  129. +99 −0 thirdparty/jasmine/src/Queue.js
  130. +31 −0 thirdparty/jasmine/src/Reporter.js
  131. +77 −0 thirdparty/jasmine/src/Runner.js
  132. +242 −0 thirdparty/jasmine/src/Spec.js
  133. +82 −0 thirdparty/jasmine/src/Suite.js
  134. +13 −0 thirdparty/jasmine/src/WaitsBlock.js
  135. +52 −0 thirdparty/jasmine/src/WaitsForBlock.js
  136. +589 −0 thirdparty/jasmine/src/base.js
  137. +188 −0 thirdparty/jasmine/src/html/TrivialReporter.js
  138. +166 −0 thirdparty/jasmine/src/html/jasmine.css
  139. +183 −0 thirdparty/jasmine/src/mock-timeout.js
  140. +67 −0 thirdparty/jasmine/src/util.js
  141. +5 −0 thirdparty/jasmine/src/version.json
@@ -0,0 +1,8 @@
+---
+format: 1
+handler:
+ commit: 5b5b87daeaedc64070098ac83facbf7cd2268f05
+ branch: master
+lock: false
+repository_class: Piston::Git::Repository
+repository_url: https://github.com/pivotal/jasmine-ajax.git
@@ -0,0 +1,20 @@
+Copyright (c) 2010 Pivotal Labs
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,16 @@
+Test Driving APIs with Jasmine
+============
+**Update**: Added a mock that can be used with jQuery. The example project is the same one as the Prototype example. If you are interested in using the jQuery mock, be sure to check out `jquery/spec/javascripts/helpers/jquery-mock-ajax.js` and `jquery/spec/javascripts/helpers/SpecHelper.js`.
+
+This shows an example JavaScript app that uses Jasmine to mock Ajax requests/responses and spy on callbacks related with various responses. We are currently using separate mocks for Prototype and jQuery but will soon be adding a single mock that can be used with either.
+
+Interesting Parts
+------------
+* `spec/javascripts/helpers/mock-ajax.js`: In order to mock out the actual HTTP requests, you'll want to include this file in your project and put it somewhere on Jasmine's helper lookup path. Including this file will do a number of things, including a way for you to define your own responses and tell your requests which one to use, as well as keep a list of Ajax requests for later inspection.
+* `spec/javascripts/helpers/test_responses/search.js`: By defining responses with various status codes and content, you can set expectations with Jasmine about what should happen in each of those situations. For example, you might create test responses for status codes of 200, 404, 500, and whatever other responses codes are relevant to the API you are working with. You can then hand these test responses to the Ajax mocks you create, then set expectations on which callbacks should be called in each of those contexts.
+
+Jasmine
+------------
+http://github.com/pivotal/jasmine
+
+Copyright (c) 2010 Pivotal Labs. This software is licensed under the MIT License.
@@ -0,0 +1,3 @@
+
+require 'jasmine'
+load 'jasmine/tasks/jasmine.rake'
@@ -0,0 +1,2 @@
+require 'jasmine'
+load 'jasmine/tasks/jasmine.rake'
@@ -0,0 +1,59 @@
+body {
+ margin-top: 100px;
+ text-align: center;
+}
+
+#wrap {
+ width: 800px;
+ margin: 0 auto;
+ text-align: left;
+}
+
+#twit_search {
+ margin-bottom: 75px;
+}
+
+#twit_search form {
+ color: #555555;
+ text-align: center;
+ font-size: 150%;
+}
+
+#twit_search form input[type=text] {
+ font-size: 100%;
+ color: #555555;
+ border: 2px solid black;
+ -moz-border-radius: 2px;
+ -webkit-border-radius: 2px;
+ padding: 4px 6px;
+}
+
+#twit_search form input[type=submit] {
+ font-size: 130%;
+}
+
+#results {
+ margin: 0 auto;
+ width: 60%;
+}
+
+#results li {
+ margin: 38px 0;
+}
+
+#results img {
+ clear: both;
+ margin-right: 10px;
+ float: left;
+}
+
+#results img + p {
+ font-size: 130%;
+ color: #333333;
+}
+
+#results p.user, #results p.timestamp {
+ margin-top: 5px;
+ text-align: right;
+ font-style: italic;
+}
@@ -0,0 +1,47 @@
+/* From http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ */
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, font, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ font-weight: inherit;
+ font-style: inherit;
+ font-size: 100%;
+ font-family: inherit;
+ vertical-align: baseline;
+}
+/* remember to define focus styles! */
+:focus {
+ outline: 0;
+}
+body {
+ line-height: 1;
+ color: black;
+ background: white;
+}
+ol, ul {
+ list-style: none;
+}
+/* tables still need 'cellspacing="0"' in the markup */
+table {
+ border-collapse: separate;
+ border-spacing: 0;
+}
+caption, th, td {
+ text-align: left;
+ font-weight: normal;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: "";
+}
+blockquote, q {
+ quotes: "" "";
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,60 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <title>Jasmine BDD</title>
+ <link rel="stylesheet" type="text/css" href="css/reset.css" />
+ <link rel="stylesheet" type="text/css" href="css/master.css" />
+ <script type="text/javascript" src="../../../frameworks/jquery.js"></script>
+ <script type="text/javascript" src="javascripts/TwitSearch.js"></script>
+ <script type="text/javascript" src="javascripts/TwitterApi.js"></script>
+ <script type="text/javascript" src="javascripts/Tweet.js"></script>
+</head>
+
+<body>
+<div id="wrap">
+<div id="twit_search">
+ <form action="index.html#" method="get">
+ <input type="text" name="query" id="query" />
+ <input type="submit" value="Search Twitter" />
+ </form>
+</div>
+<ul id="results"></ul>
+<script type="text/javascript">
+
+ $(function(){
+ $("#twit_search form").submit(function(e){
+ e.preventDefault();
+ var search_query = $("#query").val();
+ new TwitterApi().search(
+ search_query, {
+ onSuccess: TwitSearch.displayResults,
+ onFailure: TwitSearch.searchFailure
+ // onComplete: TwitSearch.cleanup,
+ // onFailWhale: TwitSearch.failWhale
+ }
+ );
+ });
+ });
+
+ // document.observe('dom:loaded', function(){
+ // $$("#twit_search form").first().observe("submit", function(event) {
+ // event.preventDefault();
+ // var search_query = $("query").value
+ // new TwitterApi().search(
+ // search_query, {
+ // onSuccess: TwitSearch.displayResults,
+ // onFailure: TwitSearch.searchFailure,
+ // onComplete: TwitSearch.cleanup,
+ // onFailWhale: TwitSearch.failWhale
+ // }
+ // );
+ // });
+ // });
+</script>
+</div>
+</body>
+</html>
@@ -0,0 +1,6 @@
+function Tweet(tweet){
+ this.postedAt = tweet.created_at;
+ this.text = tweet.text;
+ this.imageUrl = tweet.profile_image_url;
+ this.user = tweet.from_user;
+}
@@ -0,0 +1,32 @@
+var TwitSearch = function(){
+
+ return {
+ displayResults: function(tweets){
+ var updateStr = "";
+
+ $(tweets).each(function(index, tweet) {
+ updateStr += "<li><img src='" + tweet.imageUrl + "' alt='" + tweet.user + " profile image' />" +
+ "<p>" + tweet.text + "</p>" +
+ "<p class='user'>" + tweet.user + "</p>" +
+ "<p class='timestamp'>" + tweet.postedAt + "</p>";
+
+ });
+
+ $("#results").html(updateStr);
+ },
+
+ searchFailure: function(response){
+ $("#results").html("<h2>Oops. Something went wrong.</h2>");
+ },
+
+ cleanup: function(){},
+
+ rateLimitReached: function(){
+ console.log("rate limited");
+ },
+
+ failWhale: function(){
+ $("#results").html("<img src='images/fail-whale.png' />");
+ }
+ }
+}();
@@ -0,0 +1,31 @@
+function TwitterApi () {
+ this.baseUrl = "http://search.twitter.com/search.json"
+}
+
+TwitterApi.prototype.search = function(query, callbacks) {
+ $.ajax({
+ url: this.baseUrl,
+ data: {
+ q: query
+ },
+ type: "GET",
+ success: function(data, status, request) {
+ var tweets = [];
+ $(data.results).each(function(index, result){
+ tweets.push(new Tweet(result));
+ });
+
+ callbacks.onSuccess(tweets);
+ },
+ complete: callbacks.onComplete,
+ error: function(request, status, error){
+ errorStatus = request.status;
+
+ if (errorStatus == "500") {
+ callbacks.onFailure();
+ } else if (errorStatus == "503") {
+ callbacks.onFailWhale();
+ }
+ }
+ });
+}
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title>Jasmine Test Runner</title>
+ <link rel="stylesheet" type="text/css" href="javascripts/jasmine-0.11.1/jasmine.css" />
+ <script type="text/javascript" src="javascripts/jasmine-0.11.1/jasmine.js"></script>
+ <script type="text/javascript" src="javascripts/jasmine-0.11.1/jasmine-html.js"></script>
+
+ <!-- include source files here... -->
+ <script type="text/javascript" src="../../../frameworks/jquery.js"></script>
+ <script type="text/javascript" src="../public/javascripts/Tweet.js"></script>
+ <script type="text/javascript" src="../public/javascripts/TwitSearch.js"></script>
+ <script type="text/javascript" src="../public/javascripts/TwitterApi.js"></script>
+
+ <!-- include spec files here... -->
+ <script type="text/javascript" src="../../../lib/mock-ajax.js"></script>
+ <script type="text/javascript" src="../../../lib/spec-helper.js"></script>
+ <script type="text/javascript" src="javascripts/helpers/test_responses/search.js"></script>
+ <script type="text/javascript" src="javascripts/helpers/tweets.js"></script>
+ <script type="text/javascript" src="javascripts/TweetSpec.js"></script>
+ <script type="text/javascript" src="javascripts/TwitterApiSpec.js"></script>
+
+</head>
+<body>
+<script type="text/javascript">
+ jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
+ jasmine.getEnv().execute();
+</script>
+
+</body>
+</html>
@@ -0,0 +1,24 @@
+describe("Tweet", function(){
+ var tweet;
+
+ beforeEach(function(){
+ tweet = new Tweet(eval('(' + Tweets.noAtReply + ')'));
+ });
+
+ it("should create a pretty date", function(){
+ expect(tweet.postedAt).toEqual("Thu, 29 Jul 2010 02:18:53 +0000");
+ });
+
+ it("should store the users messages", function(){
+ expect(tweet.text).toEqual("Pres Obama on stage with the Foo fighters, jonas brothers and a whole lot of ppl..nice..");
+ });
+
+ it("should store the username", function(){
+ expect(tweet.user).toEqual("_wbrodrigues");
+ });
+
+ it("stores the users messages", function(){
+ expect(tweet.imageUrl).toEqual("http://a2.twimg.com/profile_images/1014111170/06212010155_normal.jpg");
+ });
+
+});
Oops, something went wrong.

0 comments on commit b5d2e10

Please sign in to comment.