commontator 4.11.0 → 4.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -5
  3. data/config/initializers/commontator.rb +3 -4
  4. data/lib/commontator/version.rb +1 -1
  5. data/lib/tasks/commontator_tasks.rake +5 -5
  6. data/spec/dummy/db/test.sqlite3 +0 -0
  7. data/spec/dummy/log/test.log +1825 -117831
  8. metadata +49 -407
  9. data/app/assets/javascripts/commontator/application.js~ +0 -3
  10. data/app/assets/javascripts/commontator/mentions.js~ +0 -31
  11. data/app/assets/stylesheets/commontator/application.css~ +0 -14
  12. data/app/assets/stylesheets/commontator/threads.css~ +0 -71
  13. data/app/controllers/commontator/comments_controller.rb~ +0 -160
  14. data/app/controllers/commontator/threads_controller.rb~ +0 -75
  15. data/app/mailers/commontator/subscriptions_mailer.rb~ +0 -65
  16. data/app/models/commontator/comment.rb~ +0 -124
  17. data/app/models/commontator/subscription.rb~ +0 -23
  18. data/app/views/commontator/shared/_thread.html.erb~ +0 -21
  19. data/app/views/commontator/subscriptions_mailer/comment_created.html.erb~ +0 -10
  20. data/app/views/commontator/threads/_hide_show.js.erb~ +0 -21
  21. data/app/views/commontator/threads/_hide_show_links.js.erb~ +0 -17
  22. data/app/views/commontator/threads/_show.html.erb~ +0 -118
  23. data/app/views/commontator/threads/_show.js.erb~ +0 -18
  24. data/config/initializers/commontator.rb~ +0 -290
  25. data/config/locales/en.yml~ +0 -101
  26. data/config/locales/ru.yml~ +0 -79
  27. data/config/locales/zh.yml~ +0 -79
  28. data/config/routes.rb~ +0 -25
  29. data/db/migrate/0_install_commontator.rb~ +0 -52
  30. data/db/migrate/1_add_parent_comment_id_to_commontator_comments.rb~ +0 -9
  31. data/lib/commontator.rb~ +0 -145
  32. data/lib/commontator/shared_helper.rb~ +0 -26
  33. data/lib/commontator/version.rb~ +0 -3
  34. data/spec/controllers/commontator/comments_controller_spec.rb~ +0 -612
  35. data/spec/controllers/commontator/subscriptions_controller_spec.rb~ +0 -101
  36. data/spec/controllers/commontator/threads_controller_spec.rb~ +0 -218
  37. data/spec/dummy/README.md~ +0 -3
  38. data/spec/dummy/Rakefile~ +0 -6
  39. data/spec/dummy/app/assets/javascripts/application.js~ +0 -16
  40. data/spec/dummy/app/assets/stylesheets/application.css~ +0 -14
  41. data/spec/dummy/app/controllers/application_controller.rb~ +0 -4
  42. data/spec/dummy/app/controllers/dummy_models_controller.rb~ +0 -23
  43. data/spec/dummy/app/helpers/application_helper.rb~ +0 -15
  44. data/spec/dummy/app/models/dummy_model.rb~ +0 -3
  45. data/spec/dummy/app/models/dummy_user.rb~ +0 -13
  46. data/spec/dummy/app/views/dummy_models/index.html.erb~ +0 -6
  47. data/spec/dummy/app/views/dummy_models/show.html.erb~ +0 -2
  48. data/spec/dummy/app/views/layouts/application.html.erb~ +0 -14
  49. data/spec/dummy/config.ru~ +0 -4
  50. data/spec/dummy/config/application.rb~ +0 -26
  51. data/spec/dummy/config/boot.rb~ +0 -5
  52. data/spec/dummy/config/database.yml~ +0 -25
  53. data/spec/dummy/config/environment.rb~ +0 -8
  54. data/spec/dummy/config/environments/development.rb~ +0 -31
  55. data/spec/dummy/config/environments/production.rb~ +0 -82
  56. data/spec/dummy/config/environments/test.rb~ +0 -40
  57. data/spec/dummy/config/initializers/backtrace_silencers.rb~ +0 -7
  58. data/spec/dummy/config/initializers/commontator.rb~ +0 -21
  59. data/spec/dummy/config/initializers/filter_parameter_logging.rb~ +0 -4
  60. data/spec/dummy/config/initializers/inflections.rb~ +0 -16
  61. data/spec/dummy/config/initializers/mime_types.rb~ +0 -5
  62. data/spec/dummy/config/initializers/secret_token.rb~ +0 -12
  63. data/spec/dummy/config/initializers/session_store.rb~ +0 -3
  64. data/spec/dummy/config/initializers/wrap_parameters.rb~ +0 -14
  65. data/spec/dummy/config/routes.rb~ +0 -10
  66. data/spec/dummy/db/development.sqlite3 +0 -0
  67. data/spec/dummy/db/migrate/1_create_dummy_models.rb~ +0 -7
  68. data/spec/dummy/db/migrate/2_create_dummy_users.rb~ +0 -7
  69. data/spec/dummy/db/migrate/3_acts_as_votable_migration.rb~ +0 -27
  70. data/spec/dummy/lib/controllers.rb~ +0 -10
  71. data/spec/dummy/log/development.log +0 -5969
  72. data/spec/dummy/public/404.html~ +0 -26
  73. data/spec/dummy/public/422.html~ +0 -26
  74. data/spec/dummy/public/500.html~ +0 -25
  75. data/spec/dummy/script/rails~ +0 -6
  76. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/-RolHYhJdGiLoPkoWZXQdI9AIWUjMMCa2yFJezCE_Bo.cache +0 -2
  77. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/-STzK7UuGeY3gSvnmTELWLvtRMKpmSAQCEw4ao3b1r8.cache +0 -1
  78. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/3NH8nN7uktAXgA3NqaqXTXDVic3BxBvqCxoLpGGbib4.cache +0 -0
  79. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/4_iT7KM6P2IT75Rssrk9p4crTBwM8DQWR41gmsxczL0.cache +0 -0
  80. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/58TLCXvf5bFFYY-mIUXrQNOVWlGsq7qPAoSX2OIIB8Y.cache +0 -0
  81. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6OQdyrATvNatvWu8Mp1qbuvRx-HLmzCZ5XBGYca-rZU.cache +0 -0
  82. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6UKCUV-ZLaWCoPMfMB6a2W0RCFPQzPJ6Mz-y67sH7zk.cache +0 -2
  83. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6wKNjFdNd4OHjIpLC0nq1kBWcbYg1aEYrp7ZhWoJlvY.cache +0 -1
  84. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/7Xxb5iYP5elo40JRlhNQB1gLbv3ueELK2rTinYt5xdc.cache +0 -1
  85. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/7twIKlS6VYCyLlwhsQg2vu4wLSUJsT2REHR4DjZf1oE.cache +0 -2
  86. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/87m-4EcbQnkbo2HYkQp4V9I2U3AYQO1mPeReieduolA.cache +0 -1
  87. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8B331vt8qC4iXTcVzkx3j-ET8i1oaQskj5LyqGq8mPQ.cache +0 -0
  88. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8KWvIOgvo7BVJYtdTpFuiSQQFFwZhLWYtwacZv52y48.cache +0 -0
  89. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/9yQa5M2ObK2-qDu231zMoarjVbhKUUg-ND3r2iXqB_Q.cache +0 -0
  90. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/A-ffuUI2juZT6qFpTUwUR1P8OPWcyFFN26WSUZe60Ko.cache +0 -1
  91. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/BbO4diS6uacx69Hn_bCabYlXEbWWdjHShRlfzlWSOMI.cache +0 -0
  92. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/CXhqxaQQAQ8b0Y8y0jTQyiqsZ6Oe4fZn0YiacpJ9IoI.cache +0 -1
  93. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/E1zaNOh68xzPxdtdOwRtOaMCoKivN2dxVwCP65WEi5I.cache +0 -2
  94. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/EmPkV3H8p2Snv9WyPjWran_kOMQ0MqQ1a9CVdGDd8l4.cache +0 -1
  95. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Hc12Nxe7cw2e0u2pzNsAe8D3ncQpcqLuI2NVL7aAXgw.cache +0 -1
  96. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/HdWuQr9W2mZvggsAxVjDgLYUNfg3rbI-T8KhaDIsvQk.cache +0 -0
  97. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/I7lsrHTKpbfLWqIqdDIx2RN_12yFL2PyLRyYsMxg1IU.cache +0 -1
  98. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/JOCzfBjMjX3D5BUUGh5lJ7fjzMuJrHLxAginRA2_hZQ.cache +0 -0
  99. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/JusxTSXt06IqBm9jeCMM2nTmM3Wvbl3i3L1IwEvW5YA.cache +0 -2
  100. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KAY1_IaTONtGr0KK8ihOdoA-RDXybqBMNSZLIDRHx68.cache +0 -1
  101. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KBHIDNfa4ryw9LAkYqK8GgPWne7HkX6mNYgrJajGm94.cache +0 -1
  102. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/L_lv02y00MmIFiFhg5c9zhl7CDHLSahehzLyi_mRZeY.cache +0 -0
  103. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MOT2X4iikR8v89A4N1bxDTeS1-xV8c9036TNFXmwXCM.cache +0 -1
  104. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MiX2Z4Vbha1riozZWw1U3_PGttRiZ1iQ_o4wSZJnKCs.cache +0 -3
  105. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MntKfwol0ud4LuvrX3MVPthTlfNlJZRYbQXpQBxhRrs.cache +0 -1
  106. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MrqmgPGNYJV1capJKIKJOVEQ4NiO-Z_2YhpjNteJ8B8.cache +0 -2
  107. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/NVMnAwylzGp5bjl_o9dwMAQxVAPDzc4ygddNQSD1fiw.cache +0 -0
  108. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/O2sKqGxNuCYhjzuEZVC9hX_FeemOfRn_1-CCuHBQYyg.cache +0 -1
  109. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Qy3TykLFmAt5jhSluMTaZaefcA5c_vfBRhQ7tin-gsk.cache +0 -0
  110. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/R3DpUgZ_hja1dQTIzumiP9AD_r8mlOaqv0U9QqnGQqo.cache +0 -0
  111. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/RF07mgb06A30OcDWtCaDlM5tEc1yp0uAsk986Gqs5w8.cache +0 -1
  112. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/S-6Iq5YOEpVnd_vQ0RSSfrmyIwB1dk0op35alFgJ9xA.cache +0 -2
  113. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/TKV8dUTo88gdFY-z2I7Xa5vDC1Z3LY6Paa18385MJsI.cache +0 -1
  114. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UI4zPmWfZA2d_5ZZIXqK9KmkjOKSDg6JoM7qcOIxm0Q.cache +0 -1
  115. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UP29vrIQbCkfghZGSCFxpW5gjlsgCxlVrncjjopvRqM.cache +0 -2
  116. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UoU16f4V7haEXM5GY5j4QFuNMP7PJZaAMEvVNNtNLBA.cache +0 -1
  117. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/VqPqYNG07yqcjbd7FA05Mu-jr5hzsZPaHFf8X0FFbXk.cache +0 -2
  118. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/WkN1QFvcuzXSsyNmfaK02ojXPk-8zmdEegzNPfdAEL4.cache +0 -0
  119. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/WkQX7Wiz41OKx2aGF7uffOmS04hIVZeGCondBAvwum8.cache +0 -2
  120. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/XMeYF1vwAg53eVjXVkw_IKQH2W3-9tWvtuCdqUCbPBM.cache +0 -2
  121. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/XX0Z7OM0xZKfQaAvHARpyeQNZCstNyu9MlsnwThSkg8.cache +0 -1
  122. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Y-pGNFTA6bAKxSvqZvmMVs3b4Els1aByxZVFxtJR71c.cache +0 -1
  123. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Y3p3m5V5NOm7yq56apKmF5KZUUsTfnhT_SG3fqbEJgo.cache +0 -1
  124. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/YLZuRWklL6q-csC-7A7CiOTTTYEQcA9PCdWEOm9MpNU.cache +0 -1
  125. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Yo7V5YXukEBm6z37l-TIRCJx3HZExEUBu3MUMhAzkMU.cache +0 -1
  126. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/bK6QttR8pGmMAMJO0avCBLwH0za8_bAC-yWqkU3Yj24.cache +0 -1
  127. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/cLncjrqpQXzsVBp7K0W7iG1STLrnzfGpbJXxNE7aIUk.cache +0 -2
  128. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/dBcAd64EZFdhHZNXKGXPIR7EtPGf03bzqkci2W12T8g.cache +0 -2
  129. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/d_bbPiareJHKkzFZFCl3pcwfQOFzsB1KHn4A2xxhR20.cache +0 -1
  130. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/eaHZBuJRcawVlkGZVyyRr5_4xYKVOXbCqnTcmaNXzL0.cache +0 -0
  131. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/gWnmfJty3jBn53qsJfOXKrWv4e8i3Dp80wVel-f1L1E.cache +0 -1
  132. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/gumo32Bd3W_q7MYEt9JIZEiQdHF93tLSsGfmXIm2MqU.cache +0 -1
  133. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/jKTlG9KP0iaCGHwg8kQ1amz9SHJ1OAWeCRRn9wc5w7c.cache +0 -1
  134. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/kPJfTiWbmX-q6i2rjM9MAMdEf2silSihU0_lxlTGVA8.cache +0 -1
  135. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/lrt1SWPj4qWUZUMH9xg3n9KLYUqJZxRn-XI-NTU6oTI.cache +0 -1
  136. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/mcCP5u08nlCL6TgWdzzrem9uE2rbsbG3KyIXxvWvlJE.cache +0 -3
  137. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/pC4exGjkQLXXPE0O9hjX_2AJ4DASTFeB6RGjXagxEac.cache +0 -0
  138. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/pIRh_Lq-ZhYC_XdRcqIsCtUkTnwVET0Wrrpw1EltHd8.cache +0 -2
  139. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/qfXc71sDbi1cE9f327D6ABPURPU6lLguGiJqH2fqM0w.cache +0 -1
  140. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/rBcrkzXcMaiCjwvWl8tO0eARzKZS69I3i-lfsTAFzcc.cache +0 -1
  141. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/sfl8l1_1AGn-4llkmb91Q0wHJ-A-x5gAGkIUWe1zLqo.cache +0 -1
  142. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/tFQc0MOeWpJ7t7cNP2GOzo7o9Z6YBgLEpdS0tGLvUSw.cache +0 -0
  143. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/tb9v5OemP-ADEwYnETLLi1r088kZm_TMb9ZVeTV5JxI.cache +0 -1
  144. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/uKmWfbgaNZ8FTsVK1VNuUv15rmtTHzSdJ7TQRGr0Rck.cache +0 -2
  145. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ul0QEoovfr_12YOpyWx8BJs8fvz5Ay3AZG8-lsLr-a4.cache +0 -1
  146. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/vY6eUgBIXKHqfU2ZroS-GugKPg5_fo2QBs-vS5gBN2o.cache +0 -0
  147. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/vrRc4DPAbHIJHJqsXfBYdyKUPFv8f8YYKJUrk-1zdVw.cache +0 -0
  148. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/wTET4PQq7wlxzrgvNivPJad-CACkoQS4BNxAP0FQaR4.cache +0 -0
  149. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/wcvE87iLx7cDjMDs_Yu1jKYvep-VyLEyj1eXL79KLp4.cache +0 -0
  150. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/xQeZ92qbm2t9FaRck5xUakvNP-MJ2cs0RroN-fm0Tf8.cache +0 -1
  151. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/xQz9WPf67Mu5uV4rNuOfU-y6_KWSlWcnTWrTvQPonKM.cache +0 -0
  152. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/xhYTRUOS8cIvyRp2Jn6FKnXlGOSsIM2z3HAGOJoJs7w.cache +0 -1
  153. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/yLxMFI0ARh2OKSOQLF2xEfM7sbst2vUbOBXoOuI6iTE.cache +0 -1
  154. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ynnYZxuxqerlFUytw54dl_CwP94g0U4HmGjyILWnhfQ.cache +0 -1
  155. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/zCivVPbSRpKF_X-P5OJeld32YhymG-bkjQwzqe2o6zg.cache +0 -2
  156. data/spec/dummy/tmp/cache/assets/test/sprockets/02d4b791eb831cf2057bf4703a1218d1 +0 -0
  157. data/spec/dummy/tmp/cache/assets/test/sprockets/0f196a1a50363b0a076ec6e1ee5417f6 +0 -0
  158. data/spec/dummy/tmp/cache/assets/test/sprockets/a3fb9025f90ff05a6fd4afc7ded2692c +0 -0
  159. data/spec/dummy/tmp/cache/assets/test/sprockets/a41c8be5379abec3c0d0d98e2f0d5609 +0 -0
  160. data/spec/dummy/tmp/cache/assets/test/sprockets/c69ee3cc5796188d873574179290a6ef +0 -0
  161. data/spec/dummy/tmp/cache/assets/test/sprockets/e1f674c11941d62aac1764ef3a7134e4 +0 -0
  162. data/spec/dummy/tmp/cache/assets/test/sprockets/e85565206c3e5fdf9dfeb367c85557b1 +0 -0
  163. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/-gXoYfEJ-e9QQUbNRpNa-pwMCnTc7Eqvkq6Bosde6W8.cache +0 -0
  164. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/6iNAIrMKxHltOChiHQQf9VNsLQuj2rVKz6oqWnK7aSM.cache +0 -1
  165. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/E1zaNOh68xzPxdtdOwRtOaMCoKivN2dxVwCP65WEi5I.cache +0 -2
  166. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/HsNbq1o4RbrEWNL4zXVqFfUVnXXLK_y0F0BvddDre6g.cache +0 -0
  167. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/JusxTSXt06IqBm9jeCMM2nTmM3Wvbl3i3L1IwEvW5YA.cache +0 -2
  168. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/L5DjABL_iOtoxSOLn3X7_YlxECU5EhnrVIKxJFAysgc.cache +0 -1
  169. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/PNc9TJUmRdGTSwgZvGlxKaIiJIkyoWtTPiGGWBqpHAE.cache +0 -0
  170. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/QkgTHa6nNs7XP6RPoV3yBbWWV-uo1u2-qxLuvLCFe_0.cache +0 -0
  171. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/S-6Iq5YOEpVnd_vQ0RSSfrmyIwB1dk0op35alFgJ9xA.cache +0 -2
  172. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Vuc93A9yywiFxc9CAdxrzdsAQw4jxiCa6JRzRjNxOYs.cache +0 -1
  173. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/YAPBll4U0cgs6cz-WyMRKoakK_gVOOcl9n0CvGyxPjY.cache +0 -1
  174. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/bDNeZfPBQaef5z0YajZc4jFE54nNy9gc06mPNKvvPFk.cache +0 -1
  175. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/c5Wa2loowFYFRBaMoTn1IWYXo4BGMbEy7NIi0vbvfRU.cache +0 -1
  176. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/dkn8MYu2ve_AJW6u0jjTlKrj1KBRqorOHQR0Obx2elU.cache +0 -0
  177. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/fZuAzt_-48u9C7ZXmsPgTraGDYtNC9B9zN-9-EnxJG4.cache +0 -1
  178. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/gumo32Bd3W_q7MYEt9JIZEiQdHF93tLSsGfmXIm2MqU.cache +0 -1
  179. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/ige85jXyj8X7XYr7HpA0gSTThqfPUm71HjhSJXtTbUY.cache +0 -1
  180. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/kuYeE5bV6FdXmfB_o-xhflhSDWoQhYYaaupAXODZ9dQ.cache +0 -1
  181. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/qhZbbNIRUaAOtGano94zLHjeBKUhKr4qbh2tTCi0Bnk.cache +0 -2
  182. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/wJJbzdHJHP6tchng3HhfTwmjc5LursgX8yZkAjpO5UA.cache +0 -0
  183. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/xNL1WW-qU3EvV2iTSW6F4hAFRBsCYmFKJhLjgCZkOV8.cache +0 -2
  184. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/ytHkF2DwUE6oaiLyrK6tL-0INpeNhjN6ctD7J0LNY6I.cache +0 -2
  185. data/spec/helpers/commontator/application_helper_spec.rb~ +0 -9
  186. data/spec/lib/commontator/acts_as_commontable_spec.rb~ +0 -25
  187. data/spec/lib/commontator/acts_as_commontator_spec.rb~ +0 -52
  188. data/spec/lib/commontator/commontable_config_spec.rb~ +0 -29
  189. data/spec/lib/commontator/commontator_config_spec.rb~ +0 -29
  190. data/spec/lib/commontator/controller_includes_spec.rb~ +0 -18
  191. data/spec/lib/commontator/controllers_spec.rb~ +0 -18
  192. data/spec/lib/commontator/shared_helper_spec.rb~ +0 -22
  193. data/spec/lib/commontator_spec.rb~ +0 -26
  194. data/spec/mailers/commontator/subscriptions_mailer_spec.rb~ +0 -30
  195. data/spec/models/commontator/comment_spec.rb~ +0 -82
  196. data/spec/models/commontator/subscription_spec.rb~ +0 -38
  197. data/spec/models/commontator/thread_spec.rb~ +0 -122
  198. data/spec/rails_helper.rb~ +0 -74
  199. data/spec/spec_helper.rb~ +0 -93
  200. data/vendor/assets/javascripts/mentionsInput/index.js~ +0 -3
@@ -1,26 +0,0 @@
1
- module Commontator
2
- module SharedHelper
3
- def commontator_thread(commontable)
4
- user = Commontator.current_user_proc.call(self)
5
-
6
- thread = commontable.thread
7
-
8
- render(:partial => 'commontator/shared/thread',
9
- :locals => { :thread => thread,
10
- :user => user }).html_safe
11
- end
12
-
13
- def commontator_gravatar_image_tag(user, border = 1, options = {})
14
- email = Commontator.commontator_email(user) || ''
15
- name = Commontator.commontator_name(user) || ''
16
-
17
- base = request.ssl? ? "s://secure" : "://www"
18
- hash = Digest::MD5.hexdigest(email)
19
- url = "http#{base}.gravatar.com/avatar/#{hash}?#{options.to_query}"
20
-
21
- image_tag(url, { :alt => name,
22
- :title => name,
23
- :border => border })
24
- end
25
- end
26
- end
@@ -1,3 +0,0 @@
1
- module Commontator
2
- VERSION = "4.10.5"
3
- end
@@ -1,612 +0,0 @@
1
- require 'rails_helper'
2
- require 'acts_as_votable'
3
-
4
- module Commontator
5
- RSpec.describe CommentsController, type: :controller do
6
- routes { Commontator::Engine.routes }
7
-
8
- before(:each) do
9
- setup_controller_spec
10
- @comment = Comment.new
11
- @comment.thread = @thread
12
- @comment.creator = @user
13
- @comment.body = 'Something'
14
- @comment.save!
15
- expect(@comment.is_votable?).to eq true
16
- end
17
-
18
- it "won't get new unless authorized" do
19
- get :new, :thread_id => @thread.id
20
- expect(response).to have_http_status(:forbidden)
21
-
22
- sign_in @user
23
- get :new, :thread_id => @thread.id
24
- expect(response).to have_http_status(:forbidden)
25
- end
26
-
27
- it 'must get new if authorized' do
28
- sign_in @user
29
-
30
- @user.can_read = true
31
- get :new, :thread_id => @thread.id
32
- expect(response).to redirect_to @thread
33
- expect(assigns(:comment).errors).to be_empty
34
-
35
- @user.can_read = false
36
- @user.can_edit = true
37
- get :new, :thread_id => @thread.id
38
- expect(response).to redirect_to @thread
39
- expect(assigns(:comment).errors).to be_empty
40
-
41
- @user.can_edit = false
42
- @user.is_admin = true
43
- get :new, :thread_id => @thread.id
44
- expect(response).to redirect_to @thread
45
- expect(assigns(:comment).errors).to be_empty
46
- end
47
-
48
- it "won't create unless authorized" do
49
- attributes = Hash.new
50
- attributes[:body] = 'Something else'
51
-
52
- post :create, :thread_id => @thread.id, :comment => attributes
53
- expect(response).to have_http_status(:forbidden)
54
-
55
- sign_in @user
56
- post :create, :thread_id => @thread.id, :comment => attributes
57
- expect(response).to have_http_status(:forbidden)
58
-
59
- @user.can_read = true
60
- @user.can_edit = true
61
- @user.is_admin = true
62
- expect(@thread.close).to eq true
63
- post :create, :thread_id => @thread.id, :comment => attributes
64
- expect(response).to have_http_status(:forbidden)
65
- end
66
-
67
- it 'must create if authorized' do
68
- sign_in @user
69
- attributes = Hash.new
70
-
71
- attributes[:body] = 'Something else'
72
- @user.can_read = true
73
- post :create, :thread_id => @thread.id, :comment => attributes
74
- expect(response).to redirect_to @thread
75
- expect(assigns(:comment).errors).to be_empty
76
- expect(assigns(:comment).body).to eq 'Something else'
77
- expect(assigns(:comment).creator).to eq @user
78
- expect(assigns(:comment).editor).to be_nil
79
- expect(assigns(:comment).thread).to eq @thread
80
-
81
- attributes[:body] = 'Another thing'
82
- @user.can_read = false
83
- @user.can_edit = true
84
- post :create, :thread_id => @thread.id, :comment => attributes
85
- expect(response).to redirect_to @thread
86
- expect(assigns(:comment).errors).to be_empty
87
- expect(assigns(:comment).body).to eq 'Another thing'
88
- expect(assigns(:comment).creator).to eq @user
89
- expect(assigns(:comment).editor).to be_nil
90
- expect(assigns(:comment).thread).to eq @thread
91
-
92
- attributes[:body] = 'And this too'
93
- @user.can_edit = false
94
- @user.is_admin = true
95
- post :create, :thread_id => @thread.id, :comment => attributes
96
- expect(response).to redirect_to @thread
97
- expect(assigns(:comment).errors).to be_empty
98
- expect(assigns(:comment).body).to eq 'And this too'
99
- expect(assigns(:comment).creator).to eq @user
100
- expect(assigns(:comment).editor).to be_nil
101
- expect(assigns(:comment).thread).to eq @thread
102
- end
103
-
104
- it "won't create if double posting" do
105
- sign_in @user
106
- @user.can_read = true
107
- attributes = Hash.new
108
-
109
- attributes[:body] = 'Something'
110
- post :create, :thread_id => @thread.id, :comment => attributes
111
- assert_redirected_to @thread
112
- expect(assigns(:comment).errors).not_to be_empty
113
-
114
- attributes[:body] = 'Something else'
115
- post :create, :thread_id => @thread.id, :comment => attributes
116
- expect(response).to redirect_to @thread
117
- expect(assigns(:comment).errors).to be_empty
118
- expect(assigns(:comment).body).to eq 'Something else'
119
- expect(assigns(:comment).creator).to eq @user
120
- expect(assigns(:comment).editor).to be_nil
121
- expect(assigns(:comment).thread).to eq @thread
122
-
123
- attributes[:body] = 'Something else'
124
- post :create, :thread_id => @thread.id, :comment => attributes
125
- expect(response).to redirect_to @thread
126
- expect(assigns(:comment).errors).not_to be_empty
127
- end
128
-
129
- it "won't edit unless authorized" do
130
- get :edit, :id => @comment.id
131
- expect(response).to have_http_status(:forbidden)
132
-
133
- sign_in @user
134
- get :edit, :id => @comment.id
135
- expect(response).to have_http_status(:forbidden)
136
-
137
- user2 = DummyUser.create
138
- user2.can_read = true
139
- user2.can_edit = true
140
- user2.is_admin = true
141
- sign_in user2
142
- get :edit, :id => @comment.id
143
- expect(response).to have_http_status(:forbidden)
144
-
145
- @user.can_read = true
146
- @user.can_edit = true
147
- @user.is_admin = true
148
- sign_in @user
149
- comment2 = Comment.new
150
- comment2.thread = @thread
151
- comment2.creator = @user
152
- comment2.body = 'Something else'
153
- comment2.save!
154
- get :edit, :id => @comment.id
155
- expect(response).to have_http_status(:forbidden)
156
- end
157
-
158
- it 'must edit if authorized' do
159
- sign_in @user
160
-
161
- @user.can_read = true
162
- get :edit, :id => @comment.id
163
- expect(response).to redirect_to @thread
164
- expect(assigns(:comment).errors).to be_empty
165
-
166
- @user.can_read = false
167
- @user.can_edit = true
168
- get :edit, :id => @comment.id
169
- expect(response).to redirect_to @thread
170
- expect(assigns(:comment).errors).to be_empty
171
-
172
- @user.can_edit = false
173
- @user.is_admin = true
174
- get :edit, :id => @comment.id
175
- expect(response).to redirect_to @thread
176
- expect(assigns(:comment).errors).to be_empty
177
- end
178
-
179
- it "won't update unless authorized" do
180
- attributes = Hash.new
181
- attributes[:body] = 'Something else'
182
-
183
- put :update, :id => @comment.id, :comment => attributes
184
- expect(response).to have_http_status(:forbidden)
185
- @comment.reload
186
- expect(@comment.body).to eq 'Something'
187
- expect(@comment.editor).to be_nil
188
-
189
- sign_in @user
190
- put :update, :id => @comment.id, :comment => attributes
191
- expect(response).to have_http_status(:forbidden)
192
- @comment.reload
193
- expect(@comment.body).to eq 'Something'
194
- expect(@comment.editor).to be_nil
195
-
196
- user2 = DummyUser.create
197
- user2.can_read = true
198
- user2.can_edit = true
199
- user2.is_admin = true
200
- sign_in user2
201
- put :update, :id => @comment.id, :comment => attributes
202
- expect(response).to have_http_status(:forbidden)
203
- @comment.reload
204
- expect(@comment.body).to eq 'Something'
205
- expect(@comment.editor).to be_nil
206
-
207
- @user.can_read = true
208
- @user.can_edit = true
209
- @user.is_admin = true
210
- sign_in @user
211
- comment2 = Comment.new
212
- comment2.thread = @thread
213
- comment2.creator = @user
214
- comment2.body = 'Something else'
215
- comment2.save!
216
- put :update, :id => @comment.id, :comment => attributes
217
- expect(response).to have_http_status(:forbidden)
218
- @comment.reload
219
- expect(@comment.body).to eq 'Something'
220
- expect(@comment.editor).to be_nil
221
- end
222
-
223
- it 'must update if authorized' do
224
- sign_in @user
225
- attributes = Hash.new
226
- attributes[:body] = 'Something else'
227
-
228
- @user.can_read = true
229
- put :update, :id => @comment.id, :comment => attributes
230
- expect(response).to redirect_to @thread
231
- expect(assigns(:comment).errors).to be_empty
232
- expect(assigns(:comment).editor).to eq @user
233
-
234
- @user.can_read = false
235
- @user.can_edit = true
236
- put :update, :id => @comment.id, :comment => attributes
237
- expect(response).to redirect_to @thread
238
- expect(assigns(:comment).errors).to be_empty
239
- expect(assigns(:comment).editor).to eq @user
240
-
241
- @user.can_edit = false
242
- @user.is_admin = true
243
- put :update, :id => @comment.id, :comment => attributes
244
- expect(response).to redirect_to @thread
245
- expect(assigns(:comment).errors).to be_empty
246
- expect(assigns(:comment).editor).to eq @user
247
- end
248
-
249
- it "won't delete unless authorized and not deleted" do
250
- put :delete, :id => @comment.id
251
- expect(response).to have_http_status(:forbidden)
252
- @comment.reload
253
- expect(@comment.is_deleted?).to eq false
254
-
255
- sign_in @user
256
-
257
- put :delete, :id => @comment.id
258
- expect(response).to have_http_status(:forbidden)
259
- @comment.reload
260
- expect(@comment.is_deleted?).to eq false
261
-
262
- @user.can_read = true
263
- expect(@comment.delete_by(@user)).to eq true
264
- put :delete, :id => @comment.id
265
- expect(response).to redirect_to @thread
266
- expect(assigns(:comment).errors).not_to be_empty
267
-
268
- comment2 = Comment.new
269
- comment2.thread = @thread
270
- comment2.creator = @user
271
- comment2.body = 'Something else'
272
- comment2.save!
273
- expect(@comment.undelete_by(@user)).to eq true
274
- put :delete, :id => @comment.id
275
- expect(response).to have_http_status(:forbidden)
276
- @comment.reload
277
- expect(@comment.is_deleted?).to eq false
278
- end
279
-
280
- it 'must delete if authorized and not deleted' do
281
- sign_in @user
282
-
283
- @user.can_read = true
284
- put :delete, :id => @comment.id
285
- expect(response).to redirect_to @thread
286
- expect(assigns(:comment).errors).to be_empty
287
- expect(assigns(:comment).is_deleted?).to eq true
288
- expect(assigns(:comment).editor).to eq @user
289
-
290
- user2 = DummyUser.create
291
- sign_in user2
292
- comment2 = Comment.new
293
- comment2.thread = @thread
294
- comment2.creator = @user
295
- comment2.body = 'Something else'
296
- comment2.save!
297
-
298
- expect(assigns(:comment).undelete_by(@user)).to eq true
299
- user2.can_edit = true
300
- put :delete, :id => @comment.id
301
- expect(response).to redirect_to @thread
302
- expect(assigns(:comment).errors).to be_empty
303
- expect(assigns(:comment).is_deleted?).to eq true
304
- expect(assigns(:comment).editor).to eq user2
305
-
306
- expect(assigns(:comment).undelete_by(@user)).to eq true
307
- user2.can_edit = false
308
- user2.is_admin = true
309
- put :delete, :id => @comment.id
310
- expect(response).to redirect_to @thread
311
- expect(assigns(:comment).errors).to be_empty
312
- expect(assigns(:comment).is_deleted?).to eq true
313
- expect(assigns(:comment).editor).to eq user2
314
- end
315
-
316
- it "won't undelete unless authorized and deleted" do
317
- expect(@comment.delete_by(@user)).to eq true
318
- put :undelete, :id => @comment.id
319
- expect(response).to have_http_status(:forbidden)
320
- @comment.reload
321
- expect(@comment.is_deleted?).to eq true
322
-
323
- sign_in @user
324
-
325
- put :undelete, :id => @comment.id
326
- expect(response).to have_http_status(:forbidden)
327
- @comment.reload
328
- expect(@comment.is_deleted?).to eq true
329
-
330
- @user.can_read = true
331
- expect(@comment.undelete_by(@user)).to eq true
332
- put :undelete, :id => @comment.id
333
- expect(response).to redirect_to @thread
334
- expect(assigns(:comment).errors).not_to be_empty
335
-
336
- user2 = DummyUser.create
337
- user2.can_read = true
338
- user2.can_edit = true
339
- user2.is_admin = true
340
- expect(@comment.delete_by(user2)).to eq true
341
- put :undelete, :id => @comment.id
342
- expect(response).to have_http_status(:forbidden)
343
- @comment.reload
344
- expect(@comment.is_deleted?).to eq true
345
-
346
- comment2 = Comment.new
347
- comment2.thread = @thread
348
- comment2.creator = @user
349
- comment2.body = 'Something else'
350
- comment2.save!
351
- expect(@comment.undelete_by(@user)).to eq true
352
- expect(@comment.delete_by(@user)).to eq true
353
- put :undelete, :id => @comment.id
354
- expect(response).to have_http_status(:forbidden)
355
- @comment.reload
356
- expect(@comment.is_deleted?).to eq true
357
- end
358
-
359
- it 'must undelete if authorized and deleted' do
360
- sign_in @user
361
-
362
- expect(@comment.delete_by(@user)).to eq true
363
- @user.can_read = true
364
- put :undelete, :id => @comment.id
365
- expect(response).to redirect_to @thread
366
- expect(assigns(:comment).errors).to be_empty
367
- expect(assigns(:comment).is_deleted?).to eq false
368
-
369
- user2 = DummyUser.create
370
- sign_in user2
371
- comment2 = Comment.new
372
- comment2.thread = @thread
373
- comment2.creator = @user
374
- comment2.body = 'Something else'
375
- comment2.save!
376
-
377
- expect(assigns(:comment).delete_by(@user)).to eq true
378
- user2.can_edit = true
379
- put :undelete, :id => @comment.id
380
- expect(response).to redirect_to @thread
381
- expect(assigns(:comment).errors).to be_empty
382
- expect(assigns(:comment).is_deleted?).to eq false
383
-
384
- expect(assigns(:comment).delete_by(@user)).to eq true
385
- user2.can_edit = false
386
- user2.is_admin = true
387
- put :undelete, :id => @comment.id
388
- expect(response).to redirect_to @thread
389
- expect(assigns(:comment).errors).to be_empty
390
- expect(assigns(:comment).is_deleted?).to eq false
391
- end
392
-
393
- it "won't upvote unless authorized" do
394
- put :upvote, :id => @comment.id
395
- expect(response).to have_http_status(:forbidden)
396
- @comment.reload
397
- expect(@comment.get_upvotes).to be_empty
398
- expect(@comment.get_downvotes).to be_empty
399
-
400
- sign_in @user
401
- @user.can_read = true
402
- put :upvote, :id => @comment.id
403
- expect(response).to have_http_status(:forbidden)
404
- @comment.reload
405
- expect(@comment.get_upvotes).to be_empty
406
- expect(@comment.get_downvotes).to be_empty
407
-
408
- user2 = DummyUser.create
409
- sign_in user2
410
- put :upvote, :id => @comment.id
411
- expect(response).to have_http_status(:forbidden)
412
- @comment.reload
413
- expect(@comment.get_upvotes).to be_empty
414
- expect(@comment.get_downvotes).to be_empty
415
- end
416
-
417
- it 'must upvote if authorized' do
418
- user2 = DummyUser.create
419
- user2.can_read = true
420
- sign_in user2
421
-
422
- put :upvote, :id => @comment.id
423
- expect(response).to redirect_to @thread
424
- expect(assigns(:comment).get_upvotes.count).to eq 1
425
- expect(assigns(:comment).get_downvotes).to be_empty
426
-
427
- put :upvote, :id => @comment.id
428
- expect(response).to redirect_to @thread
429
- expect(assigns(:comment).get_upvotes.count).to eq 1
430
- expect(assigns(:comment).get_downvotes).to be_empty
431
-
432
- expect(@comment.downvote_from(user2)).to eq true
433
-
434
- put :upvote, :id => @comment.id
435
- expect(response).to redirect_to @thread
436
- expect(assigns(:comment).get_upvotes.count).to eq 1
437
- expect(assigns(:comment).get_downvotes).to be_empty
438
- end
439
-
440
- it "won't downvote unless authorized" do
441
- put :downvote, :id => @comment.id
442
- expect(response).to have_http_status(:forbidden)
443
- @comment.reload
444
- expect(@comment.get_upvotes).to be_empty
445
- expect(@comment.get_downvotes).to be_empty
446
-
447
- sign_in @user
448
- @user.can_read = true
449
- put :downvote, :id => @comment.id
450
- expect(response).to have_http_status(:forbidden)
451
- @comment.reload
452
- expect(@comment.get_upvotes).to be_empty
453
- expect(@comment.get_downvotes).to be_empty
454
-
455
- user2 = DummyUser.create
456
- sign_in user2
457
- put :downvote, :id => @comment.id
458
- expect(response).to have_http_status(:forbidden)
459
- @comment.reload
460
- expect(@comment.get_upvotes).to be_empty
461
- expect(@comment.get_downvotes).to be_empty
462
- end
463
-
464
- it 'must downvote if authorized' do
465
- user2 = DummyUser.create
466
- user2.can_read = true
467
- sign_in user2
468
-
469
- put :downvote, :id => @comment.id
470
- expect(response).to redirect_to @thread
471
- expect(@comment.get_upvotes).to be_empty
472
- expect(@comment.get_downvotes.count).to eq 1
473
-
474
- put :downvote, :id => @comment.id
475
- expect(response).to redirect_to @thread
476
- expect(@comment.get_upvotes).to be_empty
477
- expect(@comment.get_downvotes.count).to eq 1
478
-
479
- expect(@comment.upvote_from(user2)).to eq true
480
-
481
- put :downvote, :id => @comment.id
482
- expect(response).to redirect_to @thread
483
- expect(@comment.get_upvotes).to be_empty
484
- expect(@comment.get_downvotes.count).to eq 1
485
- end
486
-
487
- it "won't unvote unless authorized" do
488
- expect(@comment.upvote_from(@user)).to eq true
489
-
490
- put :unvote, :id => @comment.id
491
- expect(response).to have_http_status(:forbidden)
492
- @comment.reload
493
- expect(@comment.get_upvotes.count).to eq 1
494
- expect(@comment.get_downvotes).to be_empty
495
-
496
- sign_in @user
497
- @user.can_read = true
498
- put :unvote, :id => @comment.id
499
- expect(response).to have_http_status(:forbidden)
500
- @comment.reload
501
- expect(@comment.get_upvotes.count).to eq 1
502
- expect(@comment.get_downvotes).to be_empty
503
-
504
- user2 = DummyUser.create
505
- sign_in user2
506
- put :unvote, :id => @comment.id
507
- expect(response).to have_http_status(:forbidden)
508
- @comment.reload
509
- expect(@comment.get_upvotes.count).to eq 1
510
- expect(@comment.get_downvotes).to be_empty
511
- end
512
-
513
- it 'must unvote if authorized' do
514
- user2 = DummyUser.create
515
- user2.can_read = true
516
- sign_in user2
517
-
518
- expect(@comment.upvote_from(user2)).to eq true
519
- put :unvote, :id => @comment.id
520
- expect(response).to redirect_to @thread
521
- expect(assigns(:comment).get_upvotes).to be_empty
522
- expect(assigns(:comment).get_downvotes).to be_empty
523
-
524
- put :unvote, :id => @comment.id
525
- expect(response).to redirect_to @thread
526
- expect(assigns(:comment).get_upvotes).to be_empty
527
- expect(assigns(:comment).get_downvotes).to be_empty
528
-
529
- expect(@comment.downvote_from(user2)).to eq true
530
- put :unvote, :id => @comment.id
531
- expect(response).to redirect_to @thread
532
- expect(assigns(:comment).get_upvotes).to be_empty
533
- expect(assigns(:comment).get_downvotes).to be_empty
534
- end
535
-
536
- it "won't send mail if recipients empty" do
537
- user2 = DummyUser.create
538
- user2.can_read = true
539
-
540
- @user.can_read = true
541
- sign_in @user
542
-
543
- attributes = { :body => 'Something else' }
544
- expect {
545
- post :create, :thread_id => @thread.id, :comment => attributes
546
- }.not_to change{ ActionMailer::Base.deliveries.count }
547
- expect(assigns(:comment).errors).to be_empty
548
- end
549
-
550
- it 'must send mail if recipients not empty' do
551
- user2 = DummyUser.create
552
- user2.can_read = true
553
- @thread.subscribe(user2)
554
-
555
- @user.can_read = true
556
- sign_in @user
557
-
558
- attributes = { :body => 'Something else' }
559
- expect {
560
- post :create, :thread_id => @thread.id, :comment => attributes
561
- }.to change{ ActionMailer::Base.deliveries.count }.by(1)
562
- expect(assigns(:comment).errors).to be_empty
563
- end
564
-
565
- context 'user is mentioned in the comment' do
566
- let!(:user_to_subscribe) { DummyUser.create }
567
- let!(:other_user) { DummyUser.create }
568
-
569
- let(:attributes) { { body: 'some comment' } }
570
- let(:call_request) { post :create, thread_id: @thread.id,
571
- comment: attributes,
572
- mentioned_ids: [user_to_subscribe.id] }
573
-
574
- before do
575
- @user.can_read = true
576
- sign_in @user
577
- end
578
-
579
- context 'mentions are disabled' do
580
- before(:all) { Commontator.mentions_enabled = false }
581
- after(:all) { Commontator.mentions_enabled = true }
582
-
583
- it 'does not subscribe any users' do
584
- expect{ call_request }.not_to change{ Subscription.count }
585
- expect(@thread.subscription_for(user_to_subscribe)).to be_nil
586
- expect(@thread.subscription_for(other_user)).to be_nil
587
- end
588
-
589
- it 'does not send a subscription emails' do
590
- expect{ call_request }.not_to change{ ActionMailer::Base.deliveries.count }
591
- end
592
- end
593
-
594
- context 'mentions are enabled' do
595
- it 'subscribes the mentioned user' do
596
- expect{ call_request }.to change{ Subscription.count }.by(1)
597
- expect(@thread.subscription_for(user_to_subscribe)).to be_present
598
- end
599
-
600
- it 'does not subscribe unmentioned users' do
601
- call_request
602
- expect(@thread.subscription_for(other_user)).to be_nil
603
- end
604
-
605
- it 'sends a subscription email' do
606
- expect{ call_request }.to change{ ActionMailer::Base.deliveries.count }.by(1)
607
- end
608
- end
609
- end
610
- end
611
- end
612
-