mongoid_sortable_tree 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (269) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +162 -0
  4. data/Rakefile +35 -0
  5. data/app/assets/javascripts/mongoid_sortable_tree.coffee +73 -0
  6. data/app/controllers/mongoid_sortable_tree_controller.rb +97 -0
  7. data/app/helpers/mongoid_sortable_tree_helper.rb +96 -0
  8. data/app/helpers/render_sortable_tree_helper.rb +36 -0
  9. data/config/routes.rb +2 -0
  10. data/lib/mongoid_sortable_tree/engine.rb +7 -0
  11. data/lib/mongoid_sortable_tree/version.rb +3 -0
  12. data/lib/mongoid_sortable_tree.rb +57 -0
  13. data/lib/tasks/mongoid_sortable_tree_tasks.rake +4 -0
  14. data/test/dummy/README.rdoc +28 -0
  15. data/test/dummy/Rakefile +6 -0
  16. data/test/dummy/app/assets/javascripts/application.js +17 -0
  17. data/test/dummy/app/assets/javascripts/tags.js +5 -0
  18. data/test/dummy/app/assets/stylesheets/application.css +16 -0
  19. data/test/dummy/app/assets/stylesheets/tags.css +4 -0
  20. data/test/dummy/app/controllers/application_controller.rb +5 -0
  21. data/test/dummy/app/controllers/tags_controller.rb +6 -0
  22. data/test/dummy/app/helpers/application_helper.rb +2 -0
  23. data/test/dummy/app/helpers/tags_helper.rb +2 -0
  24. data/test/dummy/app/models/tag.rb +4 -0
  25. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  26. data/test/dummy/app/views/tags/index.html.erb +3 -0
  27. data/test/dummy/bin/bundle +3 -0
  28. data/test/dummy/bin/rails +4 -0
  29. data/test/dummy/bin/rake +4 -0
  30. data/test/dummy/bin/setup +29 -0
  31. data/test/dummy/config/application.rb +29 -0
  32. data/test/dummy/config/boot.rb +5 -0
  33. data/test/dummy/config/environment.rb +5 -0
  34. data/test/dummy/config/environments/development.rb +38 -0
  35. data/test/dummy/config/environments/production.rb +76 -0
  36. data/test/dummy/config/environments/test.rb +42 -0
  37. data/test/dummy/config/initializers/assets.rb +11 -0
  38. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  39. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  40. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  41. data/test/dummy/config/initializers/inflections.rb +16 -0
  42. data/test/dummy/config/initializers/mime_types.rb +4 -0
  43. data/test/dummy/config/initializers/session_store.rb +3 -0
  44. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  45. data/test/dummy/config/locales/en.yml +23 -0
  46. data/test/dummy/config/mongoid.yml +31 -0
  47. data/test/dummy/config/mongoid.yml.example +16 -0
  48. data/test/dummy/config/routes.rb +61 -0
  49. data/test/dummy/config/secrets.yml +22 -0
  50. data/test/dummy/config.ru +4 -0
  51. data/test/dummy/log/development.log +0 -0
  52. data/test/dummy/log/test.log +5743 -0
  53. data/test/dummy/public/404.html +67 -0
  54. data/test/dummy/public/422.html +67 -0
  55. data/test/dummy/public/500.html +66 -0
  56. data/test/dummy/public/favicon.ico +0 -0
  57. data/test/dummy/test/controllers/tags_controller_test.rb +7 -0
  58. data/test/dummy/test/factories/tags.rb +5 -0
  59. data/test/dummy/test/models/tag_test.rb +7 -0
  60. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-8QgiuqJNyx7584K7NHwpoZ-1CHc5K6D8vO5a76W-Mk.cache +0 -0
  61. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-FF9YZZk3MBqmM5MmhHAKLA44HdgkqdV_DVwPN6b0IQ.cache +0 -0
  62. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-YETADVGs9UiLSY_AaYnavuJ4DhlDTAGJ1_gWV_m1ac.cache +1 -0
  63. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-hU_05LUo9nL_I84j2nRwUzotmHOIDZPz7S0mo_pw6A.cache +0 -0
  64. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/0cSPF0GnqGK2gT6WrARJflvshWkZzMtaOsituc7uH5I.cache +0 -0
  65. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/1lWHyPuxBbGEfZcnMATWvLOM7Rr5DebvZH25L8qfHQo.cache +1 -0
  66. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/1spSyD3OikScWv9J-BHxLwoIyoc50Ie4Wod4p2Li1x0.cache +2 -0
  67. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2Hv3UttI050UOWJ7WwZePZLPamAOXzUUZNW3qLWL2BQ.cache +1 -0
  68. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2KMM2fwI0y0fxEqgqal7l4dgDFcFM0pbLMfxlEHZ1pc.cache +1 -0
  69. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2hJ4zq-UI-ilzv3WKQjB9enBpu4hZgPRATcFOOCYqNg.cache +1 -0
  70. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/3XunDrGHcn8r5fK4kNwWR7kBC0pqNvJ_IYlHawtiiOk.cache +1 -0
  71. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5AE8ZmejamsLuGJ-uliVvGLFd03rYfK2F_kPR5P5F08.cache +1 -0
  72. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +2 -0
  73. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5bppl0UuQaBv-elQ0tAypOzARtiqn3WxL6VTL_lc5lM.cache +0 -0
  74. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5dwH57t4G1f3AjO-KHJaoIFi0EJkRkBH_whufzp2zyI.cache +0 -0
  75. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5fCD86lA3q0EFoaIZk5EF67JrnYvZBE659n8vwEvfQQ.cache +0 -0
  76. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5uddwDeoNUSzQXNr4x4rWZkDfvQcYzuZ1MuZq0hIrpc.cache +0 -0
  77. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5wtbA9MhSh_NGzq01VGz3-ZILb9UmMj4NS6acnjhGkA.cache +0 -0
  78. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/67JfKHaonSIx3bnYswsP0g8Vw2aIIdvxgzauecopZJ4.cache +1 -0
  79. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/693LYlns796uzyM_KSyOgHBKoNUZRs-LL49ciULfH2c.cache +1 -0
  80. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/6D1diGFqY1kA9O6ilKEvbVkm8tip3mxKZI3WafwH4jQ.cache +0 -0
  81. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/6ZSjWB8Af4WoK9tyMmBaGlKIiGR9wB6TbMlyIuQTDLg.cache +0 -0
  82. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/6qra6k98bkRDlZAfwlIwhJhWYfpslFLS6XkP0saIqhs.cache +1 -0
  83. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/7-rneT3H46gDfX-wasQTDtoGPCA0qjD2eKCRxFH0_e0.cache +0 -0
  84. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/7OJOjN8EyWrkfnqj_AUsJXVJYVa9ykbrqT2W4lB4h74.cache +0 -0
  85. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/7RoKHeQQ4Mbu-d5eDnUWEpexu9sK0VTdmmaCaX1Zg50.cache +1 -0
  86. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/7ZDe_ZWIuNNq_anrL61geXVF-RkYxpDaautJZ4PNRMU.cache +0 -0
  87. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/9LTAmtfXMuj74tfL2YMoJYgAFmk_d5C0dA3BUrqgdio.cache +1 -0
  88. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/9iayo4GYzOaSyGhYSCMdRzfaPUiGuRfroAroZTlPtl8.cache +0 -0
  89. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/9zwfK5pW6ZUsVvP85wvhUCjqGD4Wuq4V_VHNJgYr5-E.cache +1 -0
  90. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/A3I4iwdPfuMe5QUvb3LeKFCydBznKwRi17BppdPuWwQ.cache +1 -0
  91. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/AQFKEtOzeisjBiVFSSU91rKphpWQPunLwNpVfKRnd6w.cache +0 -0
  92. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/AxjixA6-9f4n8ME-cf9gJjeMmnC-Kxg5_nA4U1_hUfE.cache +1 -0
  93. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/B287FpA2uegWtn28rzQvD5phOc305pMqubvxJTTI02g.cache +1 -0
  94. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/BbJzQmzK2GaM17AePvMzBbzj1lORCGWH8YZ4udacs_E.cache +1 -0
  95. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/C3-GmW_WSqr8Rjx_iv5TGEwbf5prtzzuNlmveOKM_bM.cache +1 -0
  96. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/DpkEssOZUAIdPlXq6WOYMUPLGNEF-EyHY4wQMEXEEqc.cache +0 -0
  97. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/EP0L8J9jzZ3jHHjufSqjEUijYKCo7mXhjOiOgcrQqAw.cache +3 -0
  98. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/EV-CiPMKub1wavxvvFXfs1pFQhxUsy_nbAwvkv47QmA.cache +97 -0
  99. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/EVwSpiVM_Ou6acLUeBjY9goEOwTWQh64dwrz048_lck.cache +0 -0
  100. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Ew9hxtjkJFDwkGvq_-VU0MBboOib3F5V51HUq8NmmKE.cache +1 -0
  101. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/F1RpGZ90fbOvKy_PW9pw4yG5uBQyddUJkIOUTDuKcus.cache +0 -0
  102. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/FistDi7CZvBJrCuXvtY39nIonI3BANgSpsW3vsGPpfE.cache +0 -0
  103. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/FlFzT5xcfC4NlFVUsPbolKt2JIjbbgCTM78FWeh7cps.cache +0 -0
  104. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/FlLJOCERbDUYQr1KcYw5jqwQJ2KWM6HPHUIeMDY69Ak.cache +1 -0
  105. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/GeXpdMboQdcoXlNvlZfkbOGsLkLdbCDpKFb0Zrd5kkM.cache +1 -0
  106. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Gzo84GbDWTzDnnmr2BG34a4-WILka2kHDX8odeJ-vhQ.cache +1 -0
  107. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/H8yPRDyPh__z5XPO3W7kvAR9RrZG4qvPcpQvfiQ2KDI.cache +1 -0
  108. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ICwObrv8-G4aM6lUtm5iiLuj_RiBJwhytm5eqcLsgRo.cache +0 -0
  109. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/IPGXQQCD2AnwsjikA5a5l5AAhkqpO1FD9zVl5Eukdqk.cache +1 -0
  110. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/IXoeq_TTNKaSGoeqkrGKKiY_3RoIzrI24scBiLx1QhY.cache +4 -0
  111. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/IeJHUBQYriiq23EJHAFLENacqIIf5YodrL9MhBjJU3w.cache +3 -0
  112. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/JOaeOEkP615RFZqkkkbGmKPMivNPIfMFYeHm2qqGnmk.cache +0 -0
  113. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/JnRPK4kBTSpoGwRDqzsCtKp5yRPqNY-Ava27hKdRj9s.cache +1 -0
  114. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/KJfVEWLoeIP21tpHCs5IbSECrMFy2iIQDZlZUPMSAuc.cache +96 -0
  115. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Kb71IVT-T3cp9Aw_ZONJzrWnb6K6JTUIA_C7LxC6o10.cache +1 -0
  116. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/KltXsy5Zh6r4nzw5qTO_7IjFM_RkArZXVA-2ktS4A4s.cache +3 -0
  117. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/KojpFgEnwHw8_al_n5nZqHrXjxpjyc86XfBeXwcWxcU.cache +1 -0
  118. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/L175VLDL_rDCflZugn63HDKEYCiL1Xi-4d_IrO9oV0c.cache +0 -0
  119. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/LJzDjyjymoPCmmbRIVvFnNj7L8vhCVKKogLc9GVyKYY.cache +0 -0
  120. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/LRgLZIjClyRe1BkQAUjLKnv_7vEFMpjCOhWzYVytZoo.cache +0 -0
  121. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/LsbBsOQ6Vt8RF6oNjddwMWedE6IlEI2cxRWTLd8VTy4.cache +3 -0
  122. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/MT36lG90yTAaHBb7hmeiTwaObnUB6CEuH37HALxliXs.cache +0 -0
  123. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/MTfeX7i9zOHjCifDgjQWroMa26GCNtubn4ougGjT3Ko.cache +1 -0
  124. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/MVZjJSGC2FiQQ9Kg2lQ4kUVafhJZslEwrnSdQxg6Vvc.cache +0 -0
  125. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/MsX6mv2EkE6XeXQfA1HG3M48qz-3MCz1yB0weQNi7L0.cache +0 -0
  126. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Mvcn3LcfYUo25UpZ7eFOZnjfotjAHA20sgmZRYn36lY.cache +1 -0
  127. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/N-_1aBMWWrovDFoafhaGQjAkVzFq7YE5XGdqD7IoNCw.cache +0 -0
  128. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/N0P_6teb_KbdBYAZhN5dFKoeRufvjvFzTxqpNrxwMjg.cache +0 -0
  129. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/N5gSDb63c1wKeW2XMLVxmZ9fjZcpAOGQOvkl9ti5kFo.cache +0 -0
  130. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/NCJG9F7gI-hlavcsxx4jeFTMbpN-99G1GN9QfeLU8tM.cache +1 -0
  131. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/NM0G1hMfa6YGYOBhtVEDtijHaDPaX6lvkcLojWi4ywY.cache +3 -0
  132. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/NSqJPSQZBTP-86CFB2qBCBbHiGyb_jZwb89QWjAzQEs.cache +0 -0
  133. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Ndvkef-A85MEszJ4XnG08eBP4Gl1En3yc8ngmtAF4Gk.cache +3 -0
  134. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Nj6cGxzs1Bv1mG5CqM6LfluF8V0-pQ0PvfnLNM7s7tk.cache +0 -0
  135. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OD_qu5nnv4ddKeOm_8JABsWl96MWzAtbp0gNjlBiz2s.cache +0 -0
  136. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +2 -0
  137. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OMpVv-h3jA8Jc1fb9tN5lLHzSJSH357lEO-R-RKHBwY.cache +0 -0
  138. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OhBEVS4zNQVBmr0jEVZG1o-o0EYV02uPM3FH6eMtoW4.cache +1 -0
  139. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OsUNhbO_177BDYSaJmuFNRGDfM-yNchIna6n4Oa87N4.cache +1 -0
  140. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OvadU8uwG8k0e3bob9SkIaHj0CFUlpwfKdQHDFbvWh0.cache +0 -0
  141. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/P0ToEH3e7G5h4Ca08grSq5s40W5GHXbJ95b7MTDVQyw.cache +0 -0
  142. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Q7_XN_KVeReZVJf7QxdFujOctL33VSbSJJw--OkUAoM.cache +2 -0
  143. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/QXnZ8Pgyj2eWztLE6-JmNXukZH0Mus4Enld_fG18mKo.cache +1 -0
  144. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/RC8D_0C8Fqr9Vo5aIpgrKIYPtu8-Y2ObwFt080PZdXc.cache +1 -0
  145. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/RM_WhaK_VXHrExK4aaL_H5W6VXMH4L3OtgxTMXIO64E.cache +0 -0
  146. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/RdOhmz4a9IXNXAq_JDEsmGkhBcqCHjE-TrYY0TuXKcE.cache +0 -0
  147. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/S1PivaNFawelFjnmH0FnwvNqCUqB6hpN3PfZ6UZgr7Q.cache +1 -0
  148. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/SUO0pOjSacw1MehqL-uFms4tmim8XvMqjZX2dwVFRB0.cache +0 -0
  149. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/SdbSUE2iq3c5MJK8lw2ILJY8Y6jrBDvdl3DEJaPee5I.cache +0 -0
  150. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/T-ryfC01VPWQMRmd1LjtTHt7ySfnOu6mhr-oCpXIH3k.cache +1 -0
  151. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/T7z527JBZtBmyN7L8TmAmi-yLQgCv1jSpRX454pn1no.cache +0 -0
  152. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/TJaYWHALCAo41xoR7iUALAvdbjCKGrrdo6XfL4oMADY.cache +1 -0
  153. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/TOUQkNZACmIqM2aaB31Tc3A7n6RB40E2uxnU4sRtgtA.cache +1 -0
  154. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/TioCv1rcY3rKmAbAQh_uAkI_HdcgYTde4A3xzFHUhec.cache +1 -0
  155. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UJ1g7gZhpf0NzSHgO9YORzMaZc1o1JnUNVbtCVNrCOs.cache +1 -0
  156. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UREjRSE4FtfJ8oLE3XlMHO7XDiXPF4npcD8Mu6fb1Nw.cache +3 -0
  157. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UqaeZyoPtWXuMo-uv-TwznoWQCGo-AwHO61HtdJm46Y.cache +0 -0
  158. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/V4y_VwMrvIOrtk46HTsAJ2VBmeYlAbYIwzA6C-5_-mM.cache +0 -0
  159. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VMYOr-P28T7uLDd6psr1lrAZFTyiZX_x8okSf2eBSy8.cache +0 -0
  160. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VPbbyxpjGwpPubVqeL7Yw8cN1Q-lAnCYYyibl6ynDjc.cache +1 -0
  161. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VgQcvFtqYGDvZdYQYaGGKdmIPQBtleLpWo2vYW9WXOI.cache +2 -0
  162. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Vtm4P6joFaIQJulmA9kk5koqQc67nwlVNz31TeXROfo.cache +2 -0
  163. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/WDLtVqsTwhrIitEVPGjqVlEGVIxx1ggcBupfSrApP0c.cache +1 -0
  164. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/X3WyHJ-ZJGmO3lM7qHo-pdYStNdKQ4Knl6zvxSgeOcc.cache +0 -0
  165. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/XH2xCR82erPt2uXD-lbA02Tp9U71JR-e9rQdog0pRIY.cache +1 -0
  166. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Y-_h6jGIGVTJtZSvyS6fANLACrl-m3WVnMomVDENGuI.cache +1 -0
  167. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/YF6jtYkSzf630l-hXlaN0qX76w3sgapgZj5nXN88rnw.cache +3 -0
  168. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/YHvDdEuZhvl6_AsWhMLxo5LkyfiOjnenGX8PCO1Ykd4.cache +1 -0
  169. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Ycl1W3bSHE9zjTulbRUpNUxuCs_Ftm2DUbWVDtgsYN8.cache +2 -0
  170. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/YyXbluihycr-JsL-_oef5wByg7zcKNtIR-DUswxDswo.cache +1 -0
  171. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Zk5gWfebX72f8NdUBUCHE2SVwKvjLU1jTXY_mZuqkYI.cache +0 -0
  172. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ZkzgZAc5oo5rx9kltxEvkM_ViUyjr1LKsH7lrYcoV48.cache +1 -0
  173. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_Lu1XYWqZx6MsRmPL-MOi6sHlEg_g11-iKtf8JBDdr8.cache +1 -0
  174. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_Nb1U0I-n82rc9Pwd2qMJXuL9Wkn5qlV4mC1Ud6ikj4.cache +1 -0
  175. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_QE7HINNqiWAEHBSxydiBY-c5yYDSNhx1AHtytjVkos.cache +0 -0
  176. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_mxDPJ2y8cJgpgqMgPvdXsFCFVqug6HSs9R-T739diM.cache +1 -0
  177. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_rw2s46VzILFWqa4gPD6AYo_RqLmPfQFCWYqYr5DgcA.cache +0 -0
  178. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/aAMwXVMthBPsleeqieBnyAavwsI1w8IrYQS26rmHZQk.cache +1 -0
  179. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/aU-srtEIeuhft3P34XNmil6_3cWMT3dbDCk6Mvf3v5s.cache +1 -0
  180. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/aaKrJ450YBrn3N7on5RzuwGJBRSYXCLhPkQtfQsBqYE.cache +1 -0
  181. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/axzFWEMnqovcg5LtJ_dcbw3FBmBITR-q0xH8NWYU_go.cache +1 -0
  182. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/b7E-diodANePNuqym4DVNGh0BiszsuQfPvI6_gAm_Ag.cache +1 -0
  183. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/bCtmHD0AL8eRgix_TYEdj9i1hZeifzTnmlIJhQys19w.cache +0 -0
  184. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/bD3UL88a88S4Bmc4HP63UbKIG86InCVaeGiy1FWw-PU.cache +1 -0
  185. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/bFUR2Omf2G6NcLw3wKr0JmCvH5lgF9ntzuxF4GLBk80.cache +1 -0
  186. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/btkJezvRlgIM9G0VYB97XUfaNeWHzdWScOnldlAEHLA.cache +0 -0
  187. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/cNvHu4em4H9CNeEFoz2lOObbbsvXAQszojzu0s1kp1s.cache +1 -0
  188. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/cRMBsxC60IDlza6IDT9cO2HzPQJOxTUqMglR5fwq4sU.cache +0 -0
  189. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/cbAiNkExRCpgYNOmJNYuMWICW7wKt2_eS9YjVuUYlGY.cache +1 -0
  190. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/cyYEgXu1E5u1b74wuQ3kijGfNe0TVcxhOu3-nx4U8-U.cache +1 -0
  191. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/dRu_cnaSrPLKMVLtgBN4DtIKznTzrGLl16lORVaJVbc.cache +0 -0
  192. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/dTNn4pAZIhhw36SXghp5474OOZOv21bGCD2nq6ua7kc.cache +0 -0
  193. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/e-arvbPaFkeZ9B7o-onbdguRbQqFQpuZNH7nLAUJqGQ.cache +0 -0
  194. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/eAigv8xMpEekwOdypxuClq-KRm1wpu8sl5_SpSTborY.cache +1 -0
  195. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/eHTNaWizKMR3YaAJTyeN3V43u14wi5OmY_ixp1Y1RiU.cache +1 -0
  196. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/eRN_1hdGyKxqn8_HbOjTkDW25vhRrlcwlG1HKxb3GA4.cache +0 -0
  197. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/eV_tYWcj9O3zgRpVqaUQ1HlTUNTyDxESczL4VC-LdZo.cache +1 -0
  198. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/eeMztePKGLtZFBrb_559lHbTbJwtY42ND-gSmbl3LOE.cache +1 -0
  199. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/er0IRVU2U_khvRMijMVgOG6q17Z-GbwAE_VsSIEkTp4.cache +0 -0
  200. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/fK8xKwPwmbU37gxgXP1VN0cY9g0xm_mrS3oj-UWaRiU.cache +1 -0
  201. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/fVFpKVXbA25ytjL6Zp23HmLBiDlBxfN1qbP_D8AIqSw.cache +1 -0
  202. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/fjJQqpcEfELzcB6V0ieXnjY2zc_Yse1-2XWK8pbSqr8.cache +0 -0
  203. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/fp1l3wDEsUPdtcpANzFUctJKuoRkytb7R3sLaduwdfY.cache +1 -0
  204. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/g4hY1cd1DWJ88Oe3aHZQmIbRu4l06GPtJJpuzs2vQJY.cache +0 -0
  205. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/g6XXikpWMmBuQ28xYipvnbvnje47mfJUk4d32D-ZG4c.cache +1 -0
  206. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/g7WrKVzpLP4dUi9WyFy2Ix82q4wAjG4hrc1HdGUsIFM.cache +1 -0
  207. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/gUBr9oHx7e5vnIZCL8lBaQnn2rWy2IiTOIEGxP_qMDo.cache +1 -0
  208. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/gf4Eb4r2dW7JADD_n8ZYWxBDnJCCH9RMcQl00DveQfM.cache +1 -0
  209. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/gfyR7hpkb1WAryrJNQXDGVomJ9p_Ur5knGixbzGrOog.cache +1 -0
  210. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/gucXNG3Sosc088-cVctx503X048SFjf3zMhp5_Jd_wE.cache +2 -0
  211. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hDe_nkZTEwkMOSzjHj050TqzKzwk9BnpuUPWlyO0EmE.cache +1 -0
  212. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hKwY0whr7_oldglWvPWsvRjVXYujLyEoWWpBaI-FbRA.cache +0 -0
  213. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hZi1k6tpxxCGYxRe7zY74ItcOI8gZrREOpGuA8JSpGg.cache +2 -0
  214. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/iIMOCpAcBPM3jCjb3JTM6Wnr2JfpVsdlzqhSJcyjvm0.cache +1 -0
  215. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/iZVQRrkdYA-2EK1p4IcEttC47bzph4qgevoFZg6ZxZc.cache +1 -0
  216. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/i_to4G0G_oLDWXN1hTi6VV-pguaAkfSN87vC3IvX7Z0.cache +0 -0
  217. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/jZOzxGdjMmjfn9s2GVPXUpU8_zR5o-SNhXn5P8bDLNg.cache +1 -0
  218. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/juBb11YuRIjdAwD4-1KZKO0U73RUzPucELyppe4LOqo.cache +0 -0
  219. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kAfX40y33x5c6YJ0MQLW1xinOEilSdxEDPja9ZQz5Ok.cache +0 -0
  220. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kDg0fD2pfL8G1V6VG1ZTMLV8DD6ocdy-pPrKheEAT_s.cache +1 -0
  221. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kIjU1tm15Jx_3pXXRvrgh10bAoafj3dDEbIBM4LbdNY.cache +1 -0
  222. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kLIrMBvxyPY6fxho7jns90Rc34SdZKG2kXuywK85B_c.cache +0 -0
  223. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kbKj8cRyZ07pnaBlzjTeMCjz4pH86Rk90E2AfaZiXdk.cache +1 -0
  224. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/lSLUB0PJ--GOjV3s6Vui9LykagBC2jw30Qdkm3pLk5U.cache +1 -0
  225. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/lkW2cnYDnK6G8lSR_pC5ILL9kG3sNWOt5w7m_3JwJ7k.cache +1 -0
  226. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/lqEnb92B-ANq_ZPdfvowQCSb2IX0cChwZEx0H4a9VXE.cache +1 -0
  227. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/lv4WYFQHEw-HlKvIPwc1RtT0fM3Bfdc1Zrc_Vp7wN3c.cache +0 -0
  228. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/m4mPhmupn7kj6Osamqa-49rvE3c6geAnJ8GucWdM1gE.cache +97 -0
  229. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/m9FCb3sWtW32btaTzfVN0S-Sb42UVrIblwXAQP91dyM.cache +1 -0
  230. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/mLS9Yp_-EA9f3B0LdE1btwL2RrtL8x85w7MNmlGHubA.cache +1 -0
  231. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/mW4iWNEi6BN-Zt7xgfxUR-qUCHS4YEc4SqSTd1DiPrg.cache +1 -0
  232. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/mn4P1ss9trYWr1QdxzxUAb5A9n0gvGiYGDWpYi-sJlE.cache +0 -0
  233. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/nMB9Uk_N5Gc43z8ElSLE0v1izew9E0M9U-Mp7l_Js_E.cache +1 -0
  234. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/n_0JCDAdx-Y1VFi9BY1Xt9_6aXJzdf0gwq1JEzB9K7c.cache +0 -0
  235. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ng7kpSWAAo5my5jbvNQKHqrfAbCo_gyrDNELtrjxnw0.cache +1 -0
  236. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/oIaF-n7uYcXkx0lCV5y1Mv2JY6RRNFoB8v1Y9vufb3k.cache +2 -0
  237. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/p-uzj3SHmGWpYQX6fzTHc4VZ0ykWujHIPuuCFFwPong.cache +1 -0
  238. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pEhaat2KBd5SrT7szC_8R1_6hK17FTpvoRFkmCRSD3M.cache +2 -0
  239. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pMCYAjtPyFtbKFn-p3QblcflmvaG0k6urng9hbxLwNc.cache +0 -0
  240. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pfn94KX3naIgb5CWjfrBgHzPB7EIVX66pSOuHlq8TkY.cache +0 -0
  241. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ph17nHPguZgYv0qjLjMq7Gnd_tR40PvlfBCNuD5S1kA.cache +97 -0
  242. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/qMXNmgety4YRTlGVx864sRot9befOEvrHTudcpwdR5g.cache +1 -0
  243. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/qa2DSDx2tZUMd3CdfH4LA3fMfMEyfTNHLY-Q0vHvp8U.cache +1 -0
  244. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/rhxK59rrB67ynokQoxFeoWzBfVRujzwDjvLSD1UShB0.cache +1 -0
  245. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/sYkFmQdzKBPi5ghxf3ACAbIrcBcPCG47HlhsPa0DGiw.cache +1 -0
  246. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/tBBb6EHZ17CdPorvaw9HA5Isp5emKHyv4w6dVYNeA64.cache +0 -0
  247. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ttqajwO8HhrZ3Fa6huTMcLeXhAoRC3ROR4ZoHdq_51s.cache +0 -0
  248. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/u3zehXrT4vrHpY9Na0G4uGcHpd26EmsR69bbOT57PJQ.cache +1 -0
  249. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uni5BDM9xZKnI84Ml1sSGDSMCW5pLxHZgBgdyB4Aups.cache +0 -0
  250. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uqVUgjcVwnNAtF1kmjqY0cu8LXrdoJZ0pahd0Rsk_QE.cache +0 -0
  251. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/vIZuweF69AMLh4zZp2t4TM3kYZ5NkNL0XT7RsY-ts0E.cache +1 -0
  252. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/vidGRiYTk3QPfWWADiWuFo28IBg_5uJh7tQTMB7GWT8.cache +0 -0
  253. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/vpBHN9aoEUGl1kH1GVx2kbXKNFIm7p-uxa47H3N3h94.cache +0 -0
  254. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/w5zybg8qAtXTOtdbHKxpl3HnI2ohml4BfJ_q2zuj0SQ.cache +1 -0
  255. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/wGGGcuFWnjoSVpTUFjeSXxfHFi4_deeSD9B2JxVUDH4.cache +1 -0
  256. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/wejJn1Ta6jmcF_Ni4fmiaMmuaSwlwCsQsini15GWNrA.cache +1 -0
  257. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/wpBd-Le6tc4Aw2sxW1XgmGtLkbKshvAvlF2ksL_CznQ.cache +2 -0
  258. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/wwMIRrXQ9sGUjiTA5m5uUOUUKFDXcZTMwJgltzo2k7Y.cache +1 -0
  259. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/xdK6V43TFhV2h7UcTH5epqOvX_n8lWYjlm3fgvk51Ks.cache +2 -0
  260. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/xgsXc2QY67gybXOWtv_F1wGodqa0hEWG4NpoEY6C3xQ.cache +0 -0
  261. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/xguGNc7W4NMTgZjVlR5c-x2sbNDVt1A3L20Cn09l9Bw.cache +1 -0
  262. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/yjm041vwlqdXxKwRYd4bk1owgJq0XrdLsbYFANOyXXY.cache +1 -0
  263. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/z2cf2QPxjU-LDQstaaPQ-uLVFSuNhor0whlHNePP6kg.cache +0 -0
  264. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/zL8TZx4Q6zXK9n1l5tEdlYbx-EV3w1JSN9XsylkfLqU.cache +1 -0
  265. data/test/features/can_crud_test.rb +74 -0
  266. data/test/helpers/mongoid_sortable_tree_helper_test.rb +77 -0
  267. data/test/mongoid_sortable_tree_test.rb +136 -0
  268. data/test/test_helper.rb +41 -0
  269. metadata +622 -0
@@ -0,0 +1 @@
1
+ I"�/Users/AlohaCC/.rvm/gems/ruby-2.2.2@mongoid_sortable_tree/gems/jquery-rails-4.0.5/vendor/assets/javascripts/jquery_ujs.js?type=application/javascript&pipeline=self&id=3dc9a650c016ec752e6e7d6a681761089bebe8bd6b2ca803f7c6284c4a1abae6:ET
@@ -0,0 +1 @@
1
+ "%���� x��Q�`Q������
@@ -0,0 +1 @@
1
+ I"�app/assets/javascripts/tags.js?type=application/javascript&pipeline=self&id=7b0f9de3ee11d323b8694b15556a61575de24c74bda23ee0481984eac24666aa:ET
@@ -0,0 +1 @@
1
+ I"�/Users/AlohaCC/.rvm/gems/ruby-2.2.2@mongoid_sortable_tree/gems/jstree-rails-4-3.2.1/vendor/assets/images/default/32px.png?type=image/png&id=a834772db9785bc0eb4ed0376a6140b06a33c577c84609b2ae2ee0c6aa3315bb:ET
@@ -0,0 +1 @@
1
+ "%��؁[VhhSՊ��s�}��-�5`N&��堳
@@ -0,0 +1 @@
1
+ I"}app/assets/stylesheets/application.css?type=text/css&id=7f8663a9aa6ab0ed48c241dd9bbaf814ee61e1f9da5ed187cf4f7d35ab182c40:ET
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash{ I"environment-version:ETTI"environment-paths;TTI"jprocessors:type=application/javascript&file_type=application/javascript&engines=.coffee&pipeline=self;TTI"}file-digest:///Users/AlohaCC/Dropbox/rails_projects/mongoid_sortable_tree/app/assets/javascripts/mongoid_sortable_tree.coffee;TT
@@ -0,0 +1 @@
1
+ I"�/Users/AlohaCC/.rvm/gems/ruby-2.2.2@mongoid_sortable_tree/gems/jstree-rails-4-3.2.1/vendor/assets/javascripts/jstree.js?type=application/javascript&pipeline=self&id=9b2614726fb80158457a5f3f4a2884e07f2725d5d34ed0ff6164c09855491b52:ET
@@ -0,0 +1,2 @@
1
+ "%�V��L��.�q
2
+ r�����JkOQ_3v}b�Գ
@@ -0,0 +1 @@
1
+ "%֧�NTZq�בH�L��#p3��Jg!��)
@@ -0,0 +1 @@
1
+ I"�/Users/AlohaCC/.rvm/gems/ruby-2.2.2@mongoid_sortable_tree/gems/jstree-rails-4-3.2.1/vendor/assets/images/default/throbber.gif?type=image/gif&id=34f7bf539c8acf9a9a664b3982c8d4ae6b7aeca05f9d87e68267d17b48d9aead:ET
@@ -0,0 +1 @@
1
+ "%�Ӱ�uz4��1�Yܭ���u)��V� _3���@�
@@ -0,0 +1,74 @@
1
+ require "test_helper"
2
+
3
+ class CanCrudTest < Capybara::Rails::TestCase
4
+ before do
5
+ @root = create(:tag, text: 'root', icon: 'root_icon', li_attr: 'root_li', a_attr: 'root_a')
6
+ @child_1 = create(:tag, text: 'root_child1', li_attr: "class='hello'")
7
+ @child_2 = create(:tag, text: 'root_child2', a_attr: "id='hello'")
8
+ @children_1 = create(:tag, text: 'root_child1_children1')
9
+ @root.children << @child_1
10
+ @root.children << @child_2
11
+ @child_1.children << @children_1
12
+ visit tags_path
13
+ end
14
+ it "will have jstree effect", js: true do
15
+ find_by_id("#{@root.id.to_s}").right_click
16
+ page.must_have_content('Create')
17
+ page.must_have_content('Edit')
18
+ page.must_have_content('Rename')
19
+ end
20
+
21
+ it "can create a node under parent", js: true do
22
+ find_by_id("#{@root.id.to_s}").right_click
23
+ assert_difference 'Tag.count' do
24
+ find_link('Create').click
25
+ sleep 2
26
+ end
27
+ page.must_have_xpath("//input[@value='New node']")
28
+ end
29
+
30
+ it "can rename a node", js: true do
31
+ find_by_id("#{@root.id.to_s}").right_click
32
+ find_link('Rename').click
33
+ find(:xpath, "//input[@value='root']").set('root_hello')
34
+ find(:xpath, "//input[@value='root']").native.send_keys(:return)
35
+ page.must_have_content('root_hello')
36
+ sleep 2
37
+ assert_equal 'root_hello', @root.reload.text
38
+ end
39
+
40
+ it "can delete a node", js: true do
41
+ find_by_id("#{@root.id.to_s}").find('a').double_click
42
+ find_by_id("#{@child_1.id.to_s}").right_click
43
+ assert_difference 'Tag.count', -1 do
44
+ find_link('Delete').click
45
+ sleep 2
46
+ end
47
+ page.wont_have_content('root_child1')
48
+ end
49
+
50
+ it "can move a node from A to B", js: true do
51
+ find_by_id("#{@root.id.to_s}").find('a').double_click
52
+ find_by_id("#{@child_1.id.to_s}").find('a').double_click
53
+ draggable = find_by_id("#{@children_1.id.to_s}").find('a')
54
+ droppable = find_by_id("#{@child_2.id.to_s}").find('a')
55
+ draggable.drag_to(droppable)
56
+ sleep 2
57
+ assert_equal @child_2,@children_1.reload.parent
58
+ end
59
+
60
+ it "can copy a node from A to B", js: true do
61
+ find_by_id("#{@root.id.to_s}").find('a').double_click
62
+ find_by_id("#{@child_1.id.to_s}").find('a').double_click
63
+ find_by_id("#{@children_1.id.to_s}").right_click
64
+ find_link('Edit').click
65
+ find_link('Copy').click
66
+ find_by_id("#{@child_2.id.to_s}").right_click
67
+ find_link('Edit').click
68
+ assert_difference 'Tag.count' do
69
+ find_link('Paste').click
70
+ sleep 2
71
+ end
72
+ end
73
+
74
+ end
@@ -0,0 +1,77 @@
1
+ require "test_helper"
2
+
3
+ class MongoidSortableTreeHelperTest < ActionView::TestCase
4
+ before do
5
+ @root = create(:tag, text: 'root', icon: 'root_icon', li_attr: 'root_li', a_attr: 'root_a')
6
+ @child_1 = create(:tag, text: 'root_child1', li_attr: "class='hello'")
7
+ @child_2 = create(:tag, text: 'root_child2', a_attr: "id='hello'")
8
+ @children_1 = create(:tag, text: 'root_child1_children1')
9
+ @root.children << @child_1
10
+ @root.children << @child_2
11
+ @child_1.children << @children_1
12
+ end
13
+
14
+ describe "get correct class name" do
15
+ it "with array" do
16
+ assert_equal 'tag', define_class_of_elements_of(@child_1.ancestors_and_self)
17
+ end
18
+ it "nil" do
19
+ assert_equal 'tag', define_class_of_elements_of(nil)
20
+ end
21
+ it "other case" do
22
+ assert_equal 'tag', define_class_of_elements_of(@child_1)
23
+ end
24
+ end
25
+
26
+ describe "build html for jstree" do
27
+ it "build_server_tree from all nodes" do
28
+ assert_equal("
29
+ <ul>
30
+ <li id='#{@root.id.to_s}' root_li >
31
+ <a root_a>root</a>
32
+ <ul>
33
+ <li id='#{@child_1.id.to_s}' class='hello' >
34
+ <a >root_child1</a>
35
+ <ul>
36
+ <li id='#{@children_1.id.to_s}' >
37
+ <a >root_child1_children1</a>
38
+ </li>
39
+ </ul>
40
+ </li>
41
+ </ul>
42
+ <ul>
43
+ <li id='#{@child_2.id.to_s}' >
44
+ <a id='hello'>root_child2</a>
45
+ </li>
46
+ </ul>
47
+ </li>
48
+ </ul>
49
+ ".gsub(/\s+/, ""), build_server_tree(Tag.all).gsub(/\s+/, ""))
50
+ end
51
+ it "build_server_tree from a nodes" do
52
+ assert_equal("
53
+ <ul>
54
+ <li id='#{@root.id.to_s}' root_li >
55
+ <a root_a>root</a>
56
+ <ul>
57
+ <li id='#{@child_1.id.to_s}' class='hello' >
58
+ <a >root_child1</a>
59
+ <ul>
60
+ <li id='#{@children_1.id.to_s}' >
61
+ <a >root_child1_children1</a>
62
+ </li>
63
+ </ul>
64
+ </li>
65
+ </ul>
66
+ <ul>
67
+ <li id='#{@child_2.id.to_s}' >
68
+ <a id='hello'>root_child2</a>
69
+ </li>
70
+ </ul>
71
+ </li>
72
+ </ul>
73
+ ".gsub(/\s+/, ""), build_server_tree(@root.descendants_and_self).gsub(/\s+/, ""))
74
+ end
75
+ end
76
+
77
+ end
@@ -0,0 +1,136 @@
1
+ require 'test_helper'
2
+
3
+ class MongoidSortableTreeTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, MongoidSortableTree
6
+ end
7
+
8
+ describe "build materialized path json" do
9
+ before do
10
+ @root = create(:tag, text: 'root', icon: 'root_icon', li_attr: 'root_li', a_attr: 'root_a')
11
+ @child = create(:tag, text: 'root_child')
12
+ @root.children << @child
13
+ end
14
+
15
+ describe "from root" do
16
+ it "normal case" do
17
+ assert_equal([
18
+ {
19
+ :id=> @root.id.to_s,
20
+ :text=>"root",
21
+ :icon=>'root_icon',
22
+ :li_attr=>'root_li',
23
+ :a_attr=>'root_a',
24
+ :klass=>nil,
25
+ :children=>[
26
+ {
27
+ :id=> @child.id.to_s,
28
+ :text=>"root_child",
29
+ :icon=>nil,
30
+ :li_attr=>nil,
31
+ :a_attr=>nil,
32
+ :klass=>nil,
33
+ :children=>[]
34
+ }
35
+ ]
36
+ }], Tag.build_tree_from_root)
37
+ end
38
+ it "with params[:klass]" do
39
+ assert_equal([
40
+ {
41
+ :id=> @root.id.to_s,
42
+ :text=>"root",
43
+ :icon=>'root_icon',
44
+ :li_attr=>'root_li',
45
+ :a_attr=>'root_a',
46
+ :klass=>'Tag',
47
+ :children=>[
48
+ {
49
+ :id=> @child.id.to_s,
50
+ :text=>"root_child",
51
+ :icon=>nil,
52
+ :li_attr=>nil,
53
+ :a_attr=>nil,
54
+ :klass=>'Tag',
55
+ :children=>[]
56
+ }
57
+ ]
58
+ }] , Tag.build_tree_from_root(klass: 'Tag'))
59
+ end
60
+ end
61
+
62
+ describe "from a node" do
63
+ it "normal case" do
64
+ @children_1 = create(:tag, text: 'root_child_children1')
65
+ @children_2 = create(:tag, text: 'root_child_children2')
66
+ @child.children << @children_1
67
+ @child.children << @children_2
68
+ assert_equal([
69
+ {
70
+ :id=> @child.id.to_s,
71
+ :text=>"root_child",
72
+ :icon=>nil,
73
+ :li_attr=>nil,
74
+ :a_attr=>nil,
75
+ :klass=>nil,
76
+ :children=>[
77
+ {
78
+ :id=> @children_1.id.to_s,
79
+ :text=>"root_child_children1",
80
+ :icon=>nil,
81
+ :li_attr=>nil,
82
+ :a_attr=>nil,
83
+ :klass=>nil,
84
+ :children=>[]
85
+ },
86
+ {
87
+ :id=> @children_2.id.to_s,
88
+ :text=>"root_child_children2",
89
+ :icon=>nil,
90
+ :li_attr=>nil,
91
+ :a_attr=>nil,
92
+ :klass=> nil,
93
+ :children=>[]
94
+ }
95
+ ]
96
+ }], Tag.build_tree_from_node(@child))
97
+ end
98
+ it "with params[:klass]" do
99
+ @children_1 = create(:tag, text: 'root_child_children1')
100
+ @children_2 = create(:tag, text: 'root_child_children2')
101
+ @child.children << @children_1
102
+ @child.children << @children_2
103
+ assert_equal([
104
+ {
105
+ :id=> @child.id.to_s,
106
+ :text=>"root_child",
107
+ :icon=>nil,
108
+ :li_attr=>nil,
109
+ :a_attr=>nil,
110
+ :klass=>'Tag',
111
+ :children=>[
112
+ {
113
+ :id=> @children_1.id.to_s,
114
+ :text=>"root_child_children1",
115
+ :icon=>nil,
116
+ :li_attr=>nil,
117
+ :a_attr=>nil,
118
+ :klass=>'Tag',
119
+ :children=>[]
120
+ },
121
+ {
122
+ :id=> @children_2.id.to_s,
123
+ :text=>"root_child_children2",
124
+ :icon=>nil,
125
+ :li_attr=>nil,
126
+ :a_attr=>nil,
127
+ :klass=>'Tag',
128
+ :children=>[]
129
+ }
130
+ ]
131
+ }], Tag.build_tree_from_node(@child,klass: 'Tag'))
132
+ end
133
+ end
134
+ end
135
+
136
+ end
@@ -0,0 +1,41 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+ require 'mongoid'
7
+ require 'mongoid/tree'
8
+ require "minitest/rails"
9
+ require 'simplecov'
10
+ require "minitest/rails/capybara"
11
+ SimpleCov.start 'rails'
12
+ require "minitest/reporters"
13
+ Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => true)]
14
+ # Filter out Minitest backtrace while allowing backtrace from other libraries
15
+ # to be shown.
16
+ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
17
+
18
+ # Load support files
19
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
20
+
21
+ # Load fixtures from the engine
22
+ if ActiveSupport::TestCase.respond_to?(:fixture_path=)
23
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
24
+ ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
25
+ ActiveSupport::TestCase.fixtures :all
26
+ end
27
+
28
+ Mongoid.load!("test/dummy/config/mongoid.yml", Rails.env.to_sym)
29
+
30
+ Capybara.register_driver :selenium do |app|
31
+ Capybara::Selenium::Driver.new(app, :browser => :chrome)
32
+ end
33
+
34
+ class ActiveSupport::TestCase
35
+ include FactoryGirl::Syntax::Methods
36
+ teardown :clean_mongodb
37
+
38
+ def clean_mongodb
39
+ Mongoid.purge!
40
+ end
41
+ end