magic_carpet 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +202 -0
  3. data/README.md +232 -0
  4. data/Rakefile +15 -0
  5. data/app/assets/javascripts/magic_carpet/application.js +13 -0
  6. data/app/assets/javascripts/magic_carpet/magic_carpet.js +80 -0
  7. data/app/assets/stylesheets/magic_carpet/application.css +13 -0
  8. data/app/controllers/magic_carpet/application_controller.rb +4 -0
  9. data/app/controllers/magic_carpet/js_fixtures_controller.rb +110 -0
  10. data/app/helpers/magic_carpet/application_helper.rb +4 -0
  11. data/app/helpers/magic_carpet/js_fixtures_helper.rb +139 -0
  12. data/config/routes.rb +3 -0
  13. data/lib/magic_carpet/engine.rb +12 -0
  14. data/lib/magic_carpet/version.rb +3 -0
  15. data/lib/magic_carpet.rb +4 -0
  16. data/lib/tasks/magic_carpet_tasks.rake +4 -0
  17. data/spec/controllers/magic_carpet/js_fixtures_controller_spec.rb +275 -0
  18. data/spec/dummy/README.rdoc +28 -0
  19. data/spec/dummy/Rakefile +6 -0
  20. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  21. data/spec/dummy/app/assets/javascripts/jquery-2.1.0.js +9111 -0
  22. data/spec/dummy/app/assets/javascripts/users.js +2 -0
  23. data/spec/dummy/app/assets/javascripts/wishes.js +2 -0
  24. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  25. data/spec/dummy/app/assets/stylesheets/scaffold.css +56 -0
  26. data/spec/dummy/app/assets/stylesheets/users.css +4 -0
  27. data/spec/dummy/app/assets/stylesheets/wishes.css +4 -0
  28. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  29. data/spec/dummy/app/controllers/users_controller.rb +58 -0
  30. data/spec/dummy/app/controllers/wishes_controller.rb +70 -0
  31. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  32. data/spec/dummy/app/helpers/users_helper.rb +2 -0
  33. data/spec/dummy/app/helpers/wishes_helper.rb +2 -0
  34. data/spec/dummy/app/models/user.rb +3 -0
  35. data/spec/dummy/app/models/wish.rb +4 -0
  36. data/spec/dummy/app/views/layouts/application.html.erb +19 -0
  37. data/spec/dummy/app/views/layouts/other_layout.html.erb +15 -0
  38. data/spec/dummy/app/views/shared/_id_able.html.erb +5 -0
  39. data/spec/dummy/app/views/users/_form.html.erb +29 -0
  40. data/spec/dummy/app/views/users/edit.html.erb +6 -0
  41. data/spec/dummy/app/views/users/index.html.erb +31 -0
  42. data/spec/dummy/app/views/users/new.html.erb +5 -0
  43. data/spec/dummy/app/views/users/show.html.erb +19 -0
  44. data/spec/dummy/app/views/wishes/_form.html.erb +21 -0
  45. data/spec/dummy/app/views/wishes/_some_partial.html.erb +1 -0
  46. data/spec/dummy/app/views/wishes/_wish.html.erb +6 -0
  47. data/spec/dummy/app/views/wishes/_wish_list_item.html.erb +3 -0
  48. data/spec/dummy/app/views/wishes/edit.html.erb +6 -0
  49. data/spec/dummy/app/views/wishes/index.html.erb +22 -0
  50. data/spec/dummy/app/views/wishes/local_models.html.erb +3 -0
  51. data/spec/dummy/app/views/wishes/locals.html.erb +6 -0
  52. data/spec/dummy/app/views/wishes/new.html.erb +5 -0
  53. data/spec/dummy/app/views/wishes/numbers.html.erb +4 -0
  54. data/spec/dummy/app/views/wishes/plain.html.erb +1 -0
  55. data/spec/dummy/app/views/wishes/show.html.erb +9 -0
  56. data/spec/dummy/bin/bundle +3 -0
  57. data/spec/dummy/bin/rails +4 -0
  58. data/spec/dummy/bin/rake +4 -0
  59. data/spec/dummy/config/application.rb +28 -0
  60. data/spec/dummy/config/boot.rb +5 -0
  61. data/spec/dummy/config/database.yml +25 -0
  62. data/spec/dummy/config/environment.rb +5 -0
  63. data/spec/dummy/config/environments/development.rb +29 -0
  64. data/spec/dummy/config/environments/production.rb +80 -0
  65. data/spec/dummy/config/environments/test.rb +36 -0
  66. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  67. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  68. data/spec/dummy/config/initializers/inflections.rb +16 -0
  69. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  70. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  71. data/spec/dummy/config/initializers/session_store.rb +3 -0
  72. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  73. data/spec/dummy/config/locales/en.yml +23 -0
  74. data/spec/dummy/config/routes.rb +9 -0
  75. data/spec/dummy/config.ru +4 -0
  76. data/spec/dummy/db/development.sqlite3 +0 -0
  77. data/spec/dummy/db/migrate/20140201230228_create_wishes.rb +9 -0
  78. data/spec/dummy/db/migrate/20140201230247_create_users.rb +11 -0
  79. data/spec/dummy/db/migrate/20140208042514_associate_users_and_wishes.rb +5 -0
  80. data/spec/dummy/db/schema.rb +31 -0
  81. data/spec/dummy/db/test.sqlite3 +0 -0
  82. data/spec/dummy/log/development.log +21112 -0
  83. data/spec/dummy/log/test.log +33634 -0
  84. data/spec/dummy/public/404.html +58 -0
  85. data/spec/dummy/public/422.html +58 -0
  86. data/spec/dummy/public/500.html +57 -0
  87. data/spec/dummy/public/favicon.ico +0 -0
  88. data/spec/dummy/spec/javascripts/helpers/spec_helper.js +367 -0
  89. data/spec/dummy/spec/javascripts/magic_carpet_spec.js +314 -0
  90. data/spec/dummy/spec/javascripts/support/jasmine.yml +29 -0
  91. data/spec/dummy/tmp/cache/assets/development/sprockets/0743af5c3f490550c6a448f45e6889b4 +0 -0
  92. data/spec/dummy/tmp/cache/assets/development/sprockets/0800f54ee19cf3cee10b956fa9786799 +0 -0
  93. data/spec/dummy/tmp/cache/assets/development/sprockets/082245bc7cce1345893a81643f76284a +0 -0
  94. data/spec/dummy/tmp/cache/assets/development/sprockets/08b0d9573e11dc361c93563cec2a0106 +0 -0
  95. data/spec/dummy/tmp/cache/assets/development/sprockets/09f277e17472af932cda6f7dd86ff943 +0 -0
  96. data/spec/dummy/tmp/cache/assets/development/sprockets/0e3142f2ae2a0b8902383f65b86a5299 +0 -0
  97. data/spec/dummy/tmp/cache/assets/development/sprockets/0f87038bb320b83592e071bff83e4195 +0 -0
  98. data/spec/dummy/tmp/cache/assets/development/sprockets/10925724a66880466e7f3b4e158196cb +0 -0
  99. data/spec/dummy/tmp/cache/assets/development/sprockets/10fb651bf6e564ad505e391670c11a8d +0 -0
  100. data/spec/dummy/tmp/cache/assets/development/sprockets/12090b2e7e2e9ac2632e486d02ee346a +0 -0
  101. data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  102. data/spec/dummy/tmp/cache/assets/development/sprockets/142047722c23a8e9a96c6355d224b67e +0 -0
  103. data/spec/dummy/tmp/cache/assets/development/sprockets/1b4c56479f40fe3f7fc8daf684f4f71c +0 -0
  104. data/spec/dummy/tmp/cache/assets/development/sprockets/1c3579416ea74586464f5969c6949d5d +0 -0
  105. data/spec/dummy/tmp/cache/assets/development/sprockets/1e259f0863fa6da47ded59eef77ac351 +0 -0
  106. data/spec/dummy/tmp/cache/assets/development/sprockets/21d2c592e1570709ecd1208a030cfc66 +0 -0
  107. data/spec/dummy/tmp/cache/assets/development/sprockets/220ab8240fd9e0712b64dd9ff515f5df +0 -0
  108. data/spec/dummy/tmp/cache/assets/development/sprockets/277a51802284d997817fcaca55211243 +0 -0
  109. data/spec/dummy/tmp/cache/assets/development/sprockets/28c409c3bba590030a8074120aa781db +0 -0
  110. data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  111. data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  112. data/spec/dummy/tmp/cache/assets/development/sprockets/35906b4cd565b14db8ba786fc66c7eb3 +0 -0
  113. data/spec/dummy/tmp/cache/assets/development/sprockets/371bf96e99717688ed7313a0c53f4212 +0 -0
  114. data/spec/dummy/tmp/cache/assets/development/sprockets/388a1d725ffd01cc06a34d720ea97775 +0 -0
  115. data/spec/dummy/tmp/cache/assets/development/sprockets/4050a4e5062ab95c9f32e9b6940821ea +0 -0
  116. data/spec/dummy/tmp/cache/assets/development/sprockets/442917e5b534e0e7ac0a3bac0c5299e7 +0 -0
  117. data/spec/dummy/tmp/cache/assets/development/sprockets/45ccf991e042a7cf7abe52d1125eeae3 +0 -0
  118. data/spec/dummy/tmp/cache/assets/development/sprockets/469198efe71fedae413489ff2fad66e4 +0 -0
  119. data/spec/dummy/tmp/cache/assets/development/sprockets/4817f65b5fc5c2042e04af7eb83a4c99 +0 -0
  120. data/spec/dummy/tmp/cache/assets/development/sprockets/497ff8927ce695e3febb3cdfd3e4a74e +0 -0
  121. data/spec/dummy/tmp/cache/assets/development/sprockets/510da110ae528e2d22533be39ff696c5 +0 -0
  122. data/spec/dummy/tmp/cache/assets/development/sprockets/51202fde1d49c04c5d5588ca203b7b1e +0 -0
  123. data/spec/dummy/tmp/cache/assets/development/sprockets/55ea602f40a0ad2185e22964a16b4d42 +0 -0
  124. data/spec/dummy/tmp/cache/assets/development/sprockets/596788b2d37e650dd4cf582b185f9d37 +0 -0
  125. data/spec/dummy/tmp/cache/assets/development/sprockets/5c09faba4e454de97f078861e82db15c +0 -0
  126. data/spec/dummy/tmp/cache/assets/development/sprockets/5f1a0d05e77ca8b9a1fc2a47e17a8174 +0 -0
  127. data/spec/dummy/tmp/cache/assets/development/sprockets/64de9e1fa2dd01768d6e85552dcdb18a +0 -0
  128. data/spec/dummy/tmp/cache/assets/development/sprockets/68c5fa1f98ca79274b1f6750d8611af5 +0 -0
  129. data/spec/dummy/tmp/cache/assets/development/sprockets/6bcea01ea8389e9a2ee296904803a01c +0 -0
  130. data/spec/dummy/tmp/cache/assets/development/sprockets/6fc757c2c8329244ca95d6909865bbc2 +0 -0
  131. data/spec/dummy/tmp/cache/assets/development/sprockets/7406b6e2ecfc7b024db7822fb753c796 +0 -0
  132. data/spec/dummy/tmp/cache/assets/development/sprockets/744bda5bad4a3b9b9b244a4583fb6e29 +0 -0
  133. data/spec/dummy/tmp/cache/assets/development/sprockets/786804147f5da16b37ef8932e422797c +0 -0
  134. data/spec/dummy/tmp/cache/assets/development/sprockets/793dc2ede21315a9eabfe2b0a0ff13d4 +0 -0
  135. data/spec/dummy/tmp/cache/assets/development/sprockets/7b1c8fbfabc405ee6e5c8887095e6b43 +0 -0
  136. data/spec/dummy/tmp/cache/assets/development/sprockets/7c2edc3a2733a7bc22c572af66983a2e +0 -0
  137. data/spec/dummy/tmp/cache/assets/development/sprockets/7cd1032c2c1fa8a02016ac207cd9c76f +0 -0
  138. data/spec/dummy/tmp/cache/assets/development/sprockets/7d4bf0f7a6d67ade27f05b9bbdfaa13f +0 -0
  139. data/spec/dummy/tmp/cache/assets/development/sprockets/809136388a8f6d7a862b20361fad205c +0 -0
  140. data/spec/dummy/tmp/cache/assets/development/sprockets/80ba335c5610df2a1defeab247d03cc9 +0 -0
  141. data/spec/dummy/tmp/cache/assets/development/sprockets/817b43e6477d4059b9006261356b7147 +0 -0
  142. data/spec/dummy/tmp/cache/assets/development/sprockets/81b537f4760199f4030b928268605909 +0 -0
  143. data/spec/dummy/tmp/cache/assets/development/sprockets/83521bb0fd5da34426e16d8825eb314e +0 -0
  144. data/spec/dummy/tmp/cache/assets/development/sprockets/85b590662faa5956a7cb3a38390f16ca +0 -0
  145. data/spec/dummy/tmp/cache/assets/development/sprockets/8733ef9be8fb368ac9aa5b1ccbfce14c +0 -0
  146. data/spec/dummy/tmp/cache/assets/development/sprockets/87b209c0c9da28094a8d5581a21262c6 +0 -0
  147. data/spec/dummy/tmp/cache/assets/development/sprockets/8931ae3296ab13e8eed90f434208887f +0 -0
  148. data/spec/dummy/tmp/cache/assets/development/sprockets/8cb4c1afbd9a270155d8cdd697a8b20d +0 -0
  149. data/spec/dummy/tmp/cache/assets/development/sprockets/8d1f1fbd708160b30af96a108fef6c0d +0 -0
  150. data/spec/dummy/tmp/cache/assets/development/sprockets/91ef1ca0ef363be62f4a38fb3fbc2291 +0 -0
  151. data/spec/dummy/tmp/cache/assets/development/sprockets/9a25637a28779d7c49c40044188bd0e5 +0 -0
  152. data/spec/dummy/tmp/cache/assets/development/sprockets/a0d10779d647db6ab1328734733a0e4d +0 -0
  153. data/spec/dummy/tmp/cache/assets/development/sprockets/a0e04aab47dc3631152c26632687f898 +0 -0
  154. data/spec/dummy/tmp/cache/assets/development/sprockets/a74883b193a8e72f27cba5703a696a89 +0 -0
  155. data/spec/dummy/tmp/cache/assets/development/sprockets/a839288628913e4533ef8cba740de1eb +0 -0
  156. data/spec/dummy/tmp/cache/assets/development/sprockets/a95ead461bd72142ffb3040f8cd7cfa0 +0 -0
  157. data/spec/dummy/tmp/cache/assets/development/sprockets/ac47afc414ae67e366a330dc003edf1a +0 -0
  158. data/spec/dummy/tmp/cache/assets/development/sprockets/b1d1383958868d6f0e9e05c848682d70 +0 -0
  159. data/spec/dummy/tmp/cache/assets/development/sprockets/b4ff5ac95c02b56ca97786b337f8b845 +0 -0
  160. data/spec/dummy/tmp/cache/assets/development/sprockets/b718bc4e8c8146520d982e086897fe24 +0 -0
  161. data/spec/dummy/tmp/cache/assets/development/sprockets/b848029d2fa6db3db28ccbce818b399b +0 -0
  162. data/spec/dummy/tmp/cache/assets/development/sprockets/ba05f15307eb6d2c7e31e50768867139 +0 -0
  163. data/spec/dummy/tmp/cache/assets/development/sprockets/c1a8bdfcb2dca842a48acc85d3ff658a +0 -0
  164. data/spec/dummy/tmp/cache/assets/development/sprockets/c2eb6c5cabed0e6b333c035ac8400bbc +0 -0
  165. data/spec/dummy/tmp/cache/assets/development/sprockets/c3dbe303660d299b488648fc157fd32b +0 -0
  166. data/spec/dummy/tmp/cache/assets/development/sprockets/c45af704cb234484a8e1d0852f8fe0bc +0 -0
  167. data/spec/dummy/tmp/cache/assets/development/sprockets/c4868ba5188e0672b480e24d979224d0 +0 -0
  168. data/spec/dummy/tmp/cache/assets/development/sprockets/caa2f86bb055636b69e292f2ae993914 +0 -0
  169. data/spec/dummy/tmp/cache/assets/development/sprockets/ce4b669883cb8df0ccd1c6aca12e0434 +0 -0
  170. data/spec/dummy/tmp/cache/assets/development/sprockets/cebc6db0bbb8120f430da3970b173d2f +0 -0
  171. data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  172. data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  173. data/spec/dummy/tmp/cache/assets/development/sprockets/d8a7bed1e7150777f59a9e107c1acaa8 +0 -0
  174. data/spec/dummy/tmp/cache/assets/development/sprockets/db4f843f0e597f7ba079bec345a91d58 +0 -0
  175. data/spec/dummy/tmp/cache/assets/development/sprockets/dd5a838f402c1f78ff0f6e43b3ce6624 +0 -0
  176. data/spec/dummy/tmp/cache/assets/development/sprockets/dfd7187ca1d53815395570d20d933e13 +0 -0
  177. data/spec/dummy/tmp/cache/assets/development/sprockets/e4092eb95487a855cb730373c97b8756 +0 -0
  178. data/spec/dummy/tmp/cache/assets/development/sprockets/e41b3d9532b5ef87c246ef6eb88417ed +0 -0
  179. data/spec/dummy/tmp/cache/assets/development/sprockets/e8266bddb6510ce3a2bc5ae1469ab3f6 +0 -0
  180. data/spec/dummy/tmp/cache/assets/development/sprockets/e86f67e739e4d85d5b8b1830b327ee67 +0 -0
  181. data/spec/dummy/tmp/cache/assets/development/sprockets/efc1c13c84f6f8686ade375b47913c8d +0 -0
  182. data/spec/dummy/tmp/cache/assets/development/sprockets/f1e3cae1b4d4c1085b32f88d26fd1f89 +0 -0
  183. data/spec/dummy/tmp/cache/assets/development/sprockets/f21b1a83f2c41f61ba73c424b057ee19 +0 -0
  184. data/spec/dummy/tmp/cache/assets/development/sprockets/f25cc7f3223a9259336cb2dd38df220e +0 -0
  185. data/spec/dummy/tmp/cache/assets/development/sprockets/f56253b5f374fff1a33fbbc9881c9124 +0 -0
  186. data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  187. data/spec/dummy/tmp/cache/assets/test/sprockets/10fb651bf6e564ad505e391670c11a8d +0 -0
  188. data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  189. data/spec/dummy/tmp/cache/assets/test/sprockets/142047722c23a8e9a96c6355d224b67e +0 -0
  190. data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  191. data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  192. data/spec/dummy/tmp/cache/assets/test/sprockets/371bf96e99717688ed7313a0c53f4212 +0 -0
  193. data/spec/dummy/tmp/cache/assets/test/sprockets/4050a4e5062ab95c9f32e9b6940821ea +0 -0
  194. data/spec/dummy/tmp/cache/assets/test/sprockets/51202fde1d49c04c5d5588ca203b7b1e +0 -0
  195. data/spec/dummy/tmp/cache/assets/test/sprockets/596788b2d37e650dd4cf582b185f9d37 +0 -0
  196. data/spec/dummy/tmp/cache/assets/test/sprockets/5f1a0d05e77ca8b9a1fc2a47e17a8174 +0 -0
  197. data/spec/dummy/tmp/cache/assets/test/sprockets/6fc757c2c8329244ca95d6909865bbc2 +0 -0
  198. data/spec/dummy/tmp/cache/assets/test/sprockets/81b537f4760199f4030b928268605909 +0 -0
  199. data/spec/dummy/tmp/cache/assets/test/sprockets/87b209c0c9da28094a8d5581a21262c6 +0 -0
  200. data/spec/dummy/tmp/cache/assets/test/sprockets/8cb4c1afbd9a270155d8cdd697a8b20d +0 -0
  201. data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  202. data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  203. data/spec/dummy/tmp/cache/assets/test/sprockets/f56253b5f374fff1a33fbbc9881c9124 +0 -0
  204. data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  205. data/spec/dummy/tmp/jasmine/assets/application.js +9132 -0
  206. data/spec/dummy/tmp/jasmine/assets/boot.js +204 -0
  207. data/spec/dummy/tmp/jasmine/assets/helpers/spec_helper.js +462 -0
  208. data/spec/dummy/tmp/jasmine/assets/jasmine-console-reporter.js +125 -0
  209. data/spec/dummy/tmp/jasmine/assets/jasmine-console-shims.js +31 -0
  210. data/spec/dummy/tmp/jasmine/assets/jasmine-html.js +360 -0
  211. data/spec/dummy/tmp/jasmine/assets/jasmine-specs.js +0 -0
  212. data/spec/dummy/tmp/jasmine/assets/jasmine.css +55 -0
  213. data/spec/dummy/tmp/jasmine/assets/jasmine.js +2403 -0
  214. data/spec/dummy/tmp/jasmine/assets/jquery-2.1.0.js +9112 -0
  215. data/spec/dummy/tmp/jasmine/assets/json2.js +479 -0
  216. data/spec/dummy/tmp/jasmine/assets/magic_carpet/application.js +95 -0
  217. data/spec/dummy/tmp/jasmine/assets/magic_carpet/magic_carpet.js +81 -0
  218. data/spec/dummy/tmp/jasmine/assets/magic_carpet_spec.js +317 -0
  219. data/spec/dummy/tmp/jasmine/assets/users.js +3 -0
  220. data/spec/dummy/tmp/jasmine/assets/wishes.js +3 -0
  221. data/spec/dummy/tmp/jasmine/runner.html +28 -0
  222. data/spec/dummy/tmp/pids/server.pid +1 -0
  223. data/spec/helpers/magic_carpet/js_fixtures_helper_spec.rb +249 -0
  224. data/spec/spec_helper.rb +14 -0
  225. metadata +590 -0
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/404.html -->
52
+ <div class="dialog">
53
+ <h1>The page you were looking for doesn't exist.</h1>
54
+ <p>You may have mistyped the address or the page may have moved.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/422.html -->
52
+ <div class="dialog">
53
+ <h1>The change you wanted was rejected.</h1>
54
+ <p>Maybe you tried to change something you didn't have access to.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/500.html -->
52
+ <div class="dialog">
53
+ <h1>We're sorry, but something went wrong.</h1>
54
+ </div>
55
+ <p>If you are the application owner check the logs for more information.</p>
56
+ </body>
57
+ </html>
File without changes
@@ -0,0 +1,367 @@
1
+ //= require magic_carpet/application
2
+
3
+ // Stub agent string for testing agent detection code
4
+ function stubAgent(agentString) {
5
+ var __originalNavigator = navigator;
6
+ navigator = new Object();
7
+ navigator.__proto__ = __originalNavigator;
8
+ navigator.__defineGetter__('userAgent', function () { return agentString; });
9
+ }
10
+
11
+ // Stub event object for testing DOM events
12
+ var eventStub;
13
+ // Stub promise object for testing asynchronous code
14
+ var promiseStub;
15
+
16
+ // Stub an event object with a few basic spies
17
+ // for assertions.
18
+ eventStub = {
19
+ preventDefault: jasmine.createSpy("preventDefault"),
20
+ stopPropagation: jasmine.createSpy("stopPropagation"),
21
+ target: jasmine.createSpy("target"),
22
+ keyCode: 13 // Send enter keyCode by default
23
+ };
24
+
25
+ // The promise stub requres a bit more setup to
26
+ // enable assertions. Since promises are chainable
27
+ // every spy must return the promise stub
28
+ promiseStub = jasmine.createSpy("promiseStub");
29
+ promiseStub.abort = jasmine.createSpy("abort").and.returnValue(promiseStub);
30
+ promiseStub.fail = jasmine.createSpy("fail").and.returnValue(promiseStub);
31
+ promiseStub.done = jasmine.createSpy("done").and.returnValue(promiseStub);
32
+ promiseStub.always = jasmine.createSpy("always").and.returnValue(promiseStub);
33
+
34
+ beforeEach(function() {
35
+ jasmine.addMatchers({
36
+ toBeTrue: function() {
37
+ return {
38
+ compare: function(actual) {
39
+ return {
40
+ pass: actual === true,
41
+ message: "Expected " + actual + " to be true"
42
+ };
43
+ }
44
+ };
45
+ },
46
+
47
+ toBeFalse: function() {
48
+ return {
49
+ compare: function(actual) {
50
+ return {
51
+ pass: actual === false,
52
+ message: "Expected " + actual + " to be false"
53
+ };
54
+ }
55
+ };
56
+ },
57
+
58
+ toBeEmpty: function() {
59
+ return {
60
+ compare: function(actual) {
61
+ var pass;
62
+ if ((/Array/).test(Object.prototype.toString.call(actual))) {
63
+ pass = actual.length === 0;
64
+ } else {
65
+ for (var prop in actual) {
66
+ pass = false;
67
+ }
68
+ pass = (pass === undefined) ? true : false;
69
+ }
70
+ return {
71
+ pass: pass,
72
+ message: "Expected " + actual + " to be empty"
73
+ };
74
+ }
75
+ };
76
+ },
77
+
78
+ toBeObject: function() {
79
+ return {
80
+ compare: function(actual) {
81
+ return {
82
+ pass: compareConstructor(actual, Object),
83
+ message: "Expected " + actual + " to be an Object"
84
+ };
85
+ }
86
+ };
87
+ },
88
+
89
+ toBeArray: function() {
90
+ return {
91
+ compare: function(actual) {
92
+ return {
93
+ pass: compareConstructor(actual, Array),
94
+ message: "Expected " + actual + " to be an Array"
95
+ };
96
+ }
97
+ };
98
+ },
99
+
100
+ toBeNumber: function() {
101
+ return {
102
+ compare: function(actual) {
103
+ return {
104
+ pass: compareConstructor(actual, Number),
105
+ message: "Expected " + actual + " to be a Number"
106
+ };
107
+ }
108
+ };
109
+ },
110
+
111
+ toBeString: function() {
112
+ return {
113
+ compare: function(actual) {
114
+ return {
115
+ pass: compareConstructor(actual, String),
116
+ message: "Expected " + actual + " to be a String"
117
+ };
118
+ }
119
+ };
120
+ },
121
+
122
+ toBeFunction: function() {
123
+ return {
124
+ compare: function(actual) {
125
+ return {
126
+ pass: compareConstructor(actual, Function),
127
+ message: "Expected " + actual + " to be a Function"
128
+ };
129
+ }
130
+ };
131
+ },
132
+
133
+ toBeTypeof: function() {
134
+ return {
135
+ compare: function(actual, b) {
136
+ return {
137
+ pass: compareConstructor(actual, b),
138
+ message: "Expected " + actual + " to be a typeof " + b
139
+ };
140
+ }
141
+ };
142
+ },
143
+
144
+ toDeepEqual: function() {
145
+ var eq = function(a, b, aStack, bStack) {
146
+ // Identical objects are equal. `0 === -0`, but they aren't identical.
147
+ // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
148
+ if (a === b) return a !== 0 || 1 / a == 1 / b;
149
+ // A strict comparison is necessary because `null == undefined`.
150
+ if (a == null || b == null) return a === b;
151
+ // Compare `[[Class]]` names.
152
+ var className = toString.call(a);
153
+ if (className != toString.call(b)) return false;
154
+ switch (className) {
155
+ // Strings, numbers, dates, and booleans are compared by value.
156
+ case '[object String]':
157
+ // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
158
+ // equivalent to `new String("5")`.
159
+ return a == String(b);
160
+ case '[object Number]':
161
+ // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
162
+ // other numeric values.
163
+ return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
164
+ case '[object Date]':
165
+ case '[object Boolean]':
166
+ // Coerce dates and booleans to numeric primitive values. Dates are compared by their
167
+ // millisecond representations. Note that invalid dates with millisecond representations
168
+ // of `NaN` are not equivalent.
169
+ return +a == +b;
170
+ // RegExps are compared by their source patterns and flags.
171
+ case '[object RegExp]':
172
+ return a.source == b.source &&
173
+ a.global == b.global &&
174
+ a.multiline == b.multiline &&
175
+ a.ignoreCase == b.ignoreCase;
176
+ }
177
+ if (typeof a != 'object' || typeof b != 'object') return false;
178
+ // Assume equality for cyclic structures. The algorithm for detecting cyclic
179
+ // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
180
+ var length = aStack.length;
181
+ while (length--) {
182
+ // Linear search. Performance is inversely proportional to the number of
183
+ // unique nested structures.
184
+ if (aStack[length] == a) return bStack[length] == b;
185
+ }
186
+ // Objects with different constructors are not equivalent, but `Object`s
187
+ // from different frames are.
188
+ var aCtor = a.constructor, bCtor = b.constructor;
189
+ if (aCtor !== bCtor && !(aCtor == Function && (aCtor instanceof aCtor) &&
190
+ bCtor == Function && (bCtor instanceof bCtor))
191
+ && ('constructor' in a && 'constructor' in b)) {
192
+ return false;
193
+ }
194
+ // Add the first object to the stack of traversed objects.
195
+ aStack.push(a);
196
+ bStack.push(b);
197
+ var size = 0, result = true;
198
+ // Recursively compare objects and arrays.
199
+ if (className == '[object Array]') {
200
+ // Compare array lengths to determine if a deep comparison is necessary.
201
+ size = a.length;
202
+ result = size == b.length;
203
+ if (result) {
204
+ // Deep compare the contents, ignoring non-numeric properties.
205
+ while (size--) {
206
+ if (!(result = eq(a[size], b[size], aStack, bStack))) break;
207
+ }
208
+ }
209
+ } else {
210
+ // Deep compare objects.
211
+ for (var key in a) {
212
+ if (a.hasOwnProperty(key)) {
213
+ // Count the expected number of properties.
214
+ size++;
215
+ // Deep compare each member.
216
+ if (!(result = b.hasOwnProperty(key) && eq(a[key], b[key], aStack, bStack))) break;
217
+ }
218
+ }
219
+ // Ensure that both objects contain the same number of properties.
220
+ if (result) {
221
+ for (key in b) {
222
+ if (b.hasOwnProperty(key) && !(size--)) break;
223
+ }
224
+ result = !size;
225
+ }
226
+ }
227
+ // Remove the first object from the stack of traversed objects.
228
+ aStack.pop();
229
+ bStack.pop();
230
+ return result;
231
+ };
232
+ return {
233
+ compare: function(actual, expected) {
234
+ return {
235
+ pass: eq(actual, expected, [], []),
236
+ message: "Expected " + actual + " to deep equal " + expected
237
+ };
238
+ }
239
+ };
240
+ },
241
+
242
+ // jQuery matchers
243
+ toBeJqueryWrapped: function() {
244
+ return {
245
+ compare: function(actual, selector) {
246
+ return {
247
+ pass: (selector && actual && actual.selector !== selector) ? false : checkElementExistence(actual),
248
+ message: "Expected " + actual + " to be a jQuery wrapped element"
249
+ };
250
+ }
251
+ };
252
+ },
253
+
254
+ toHaveClass: function() {
255
+ return {
256
+ compare: function(actual, className) {
257
+ return {
258
+ pass: actual.hasClass(className),
259
+ message: "Expected " + actual + " to have class " + className
260
+ };
261
+ }
262
+ };
263
+ },
264
+
265
+ toBeHidden: function() {
266
+ return {
267
+ compare: function(actual) {
268
+ return {
269
+ pass: !actual.is(":visible"),
270
+ message: "Expected " + actual + " to be hidden"
271
+ };
272
+ }
273
+ };
274
+ },
275
+
276
+ toBeVisible: function() {
277
+ return {
278
+ compare: function(actual) {
279
+ return {
280
+ pass: actual.is(":visible"),
281
+ message: "Expected " + actual + " to be visible"
282
+ };
283
+ }
284
+ };
285
+ },
286
+
287
+ toExist: function() {
288
+ return {
289
+ compare: function(actual) {
290
+ return {
291
+ pass: actual.length > 0,
292
+ message: "Expected " + actual + " to exist in the DOM"
293
+ };
294
+ }
295
+ };
296
+ },
297
+
298
+ toHaveText: function() {
299
+ return {
300
+ compare: function(actual, text) {
301
+ return {
302
+ pass: actual.text().trim() === text,
303
+ message: "Expected " + actual + " to have text " + '"' + text + '"'
304
+ };
305
+ }
306
+ };
307
+ },
308
+
309
+ toHaveHTML: function() {
310
+ return {
311
+ compare: function(actual, html) {
312
+ return {
313
+ pass: actual.html().trim() === html,
314
+ message: "Expected " + actual + " to have HTML " + '"' + html + '"'
315
+ };
316
+ }
317
+ };
318
+ },
319
+
320
+ toBeChecked: function() {
321
+ return {
322
+ compare: function(actual) {
323
+ return {
324
+ pass: actual.prop("checked"),
325
+ message: "Expected " + actual + " to be checked"
326
+ };
327
+ }
328
+ };
329
+ },
330
+
331
+ toHaveAttribute: function(attr, value) {
332
+ return {
333
+ compare: function(actual, attr, value) {
334
+ var pass;
335
+ var message;
336
+ if (value) {
337
+ pass = (actual.attr(attr) === value);
338
+ message = "Expected " + actual + ' to have the "' + attr + '" attribute with a value of "' + value + '"';
339
+ } else {
340
+ pass = !!actual.attr(attr);
341
+ message = "Expected " + actual + ' to have the "' + attr + '" attribute';
342
+ }
343
+ return {
344
+ pass: pass,
345
+ message: message
346
+ };
347
+ }
348
+ };
349
+ }
350
+ });
351
+
352
+ // compareConstructor checks an object against a specific type
353
+ function compareConstructor(a, b) {
354
+ if (typeof a === "undefined") return false;
355
+ return a.constructor == b; // double equals is important here, ignore the linter
356
+ }
357
+
358
+ // This function is an exhaustive check for the existence
359
+ // of a jQuery wrapped element. It requires an element to
360
+ // be in the DOM and to be jQuery wrapped
361
+ function checkElementExistence(element) {
362
+ if (typeof element === "undefined") return false;
363
+ if (typeof element.selector === "undefined") return false;
364
+ if (!element.length) return false;
365
+ return compareConstructor(element, jQuery);
366
+ }
367
+ });