fat_free_crm 0.12.3 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fat_free_crm might be problematic. Click here for more details.

Files changed (521) hide show
  1. checksums.yaml +5 -13
  2. data/.travis.yml +1 -11
  3. data/Gemfile +7 -19
  4. data/Gemfile.lock +166 -166
  5. data/Procfile +1 -1
  6. data/README.md +20 -20
  7. data/app/assets/javascripts/admin/fields.js.coffee +3 -3
  8. data/app/assets/javascripts/application.js.erb +3 -0
  9. data/app/assets/javascripts/crm.js +1 -0
  10. data/app/assets/javascripts/crm_comments.js.coffee +66 -0
  11. data/app/assets/javascripts/lists.js.coffee +45 -2
  12. data/app/assets/javascripts/search.js.coffee +2 -0
  13. data/app/assets/javascripts/timeago.js +17 -0
  14. data/app/assets/stylesheets/advanced_search.css.scss +49 -25
  15. data/app/assets/stylesheets/application.css.erb +3 -0
  16. data/app/assets/stylesheets/common.scss +13 -0
  17. data/app/assets/stylesheets/format_buttons.css.scss +15 -10
  18. data/app/assets/stylesheets/header.scss +3 -0
  19. data/app/assets/stylesheets/lists.css.scss +4 -0
  20. data/app/controllers/admin/fields_controller.rb +5 -5
  21. data/app/controllers/admin/users_controller.rb +1 -3
  22. data/app/controllers/application_controller.rb +23 -23
  23. data/app/controllers/comments_controller.rb +3 -31
  24. data/app/controllers/entities/accounts_controller.rb +3 -3
  25. data/app/controllers/entities/campaigns_controller.rb +4 -4
  26. data/app/controllers/entities/contacts_controller.rb +2 -2
  27. data/app/controllers/entities/leads_controller.rb +3 -3
  28. data/app/controllers/entities/opportunities_controller.rb +4 -3
  29. data/app/controllers/entities_controller.rb +6 -6
  30. data/app/controllers/home_controller.rb +1 -1
  31. data/app/controllers/lists_controller.rb +8 -1
  32. data/app/controllers/tasks_controller.rb +1 -1
  33. data/app/controllers/users_controller.rb +46 -23
  34. data/app/helpers/admin/application_helper.rb +1 -3
  35. data/app/helpers/admin/field_groups_helper.rb +2 -1
  36. data/app/helpers/application_helper.rb +37 -16
  37. data/app/helpers/home_helper.rb +1 -2
  38. data/app/helpers/leads_helper.rb +5 -6
  39. data/app/helpers/tasks_helper.rb +36 -50
  40. data/app/models/entities/account.rb +10 -7
  41. data/app/models/entities/campaign.rb +4 -4
  42. data/app/models/entities/contact.rb +8 -5
  43. data/app/models/entities/lead.rb +8 -8
  44. data/app/models/entities/opportunity.rb +13 -18
  45. data/app/models/fields/custom_field.rb +10 -0
  46. data/app/models/fields/field.rb +3 -3
  47. data/app/models/fields/field_group.rb +1 -1
  48. data/app/models/list.rb +1 -0
  49. data/app/models/polymorphic/address.rb +3 -3
  50. data/app/models/polymorphic/comment.rb +2 -4
  51. data/app/models/polymorphic/task.rb +32 -27
  52. data/app/models/setting.rb +3 -9
  53. data/app/models/users/ability.rb +2 -13
  54. data/app/models/users/user.rb +12 -15
  55. data/app/views/accounts/_edit.html.haml +1 -1
  56. data/app/views/accounts/_index_brief.html.haml +3 -3
  57. data/app/views/accounts/_index_long.html.haml +3 -3
  58. data/app/views/accounts/_new.html.haml +1 -1
  59. data/app/views/accounts/create.js.haml +17 -0
  60. data/app/views/accounts/destroy.js.haml +6 -0
  61. data/app/views/accounts/edit.js.haml +32 -0
  62. data/app/views/accounts/index.js.haml +11 -0
  63. data/app/views/accounts/index.xls.builder +9 -7
  64. data/app/views/accounts/new.js.haml +11 -0
  65. data/app/views/accounts/show.js.haml +5 -0
  66. data/app/views/accounts/update.js.haml +17 -0
  67. data/app/views/admin/field_groups/_edit.html.haml +1 -1
  68. data/app/views/admin/field_groups/_new.html.haml +1 -1
  69. data/app/views/admin/field_groups/confirm.js.haml +7 -0
  70. data/app/views/admin/field_groups/create.js.haml +20 -0
  71. data/app/views/admin/field_groups/destroy.js.haml +9 -0
  72. data/app/views/admin/field_groups/edit.js.haml +12 -0
  73. data/app/views/admin/field_groups/new.js.haml +8 -0
  74. data/app/views/admin/field_groups/update.js.haml +8 -0
  75. data/app/views/admin/fields/_field.html.haml +2 -2
  76. data/app/views/admin/fields/_form.html.haml +2 -2
  77. data/app/views/admin/fields/create.js.haml +17 -0
  78. data/app/views/admin/fields/destroy.js.haml +8 -0
  79. data/app/views/admin/fields/edit.js.haml +3 -0
  80. data/app/views/admin/fields/update.js.haml +13 -0
  81. data/app/views/admin/groups/_edit.html.haml +1 -1
  82. data/app/views/admin/groups/_new.html.haml +1 -1
  83. data/app/views/admin/groups/create.js.haml +10 -0
  84. data/app/views/admin/groups/destroy.js.haml +9 -0
  85. data/app/views/admin/groups/edit.js.haml +14 -0
  86. data/app/views/admin/groups/index.html.haml +1 -1
  87. data/app/views/admin/groups/index.js.haml +2 -0
  88. data/app/views/admin/groups/new.js.haml +9 -0
  89. data/app/views/admin/groups/update.js.haml +9 -0
  90. data/app/views/admin/tags/_edit.html.haml +1 -1
  91. data/app/views/admin/tags/_new.html.haml +1 -1
  92. data/app/views/admin/tags/confirm.js.haml +7 -0
  93. data/app/views/admin/tags/create.js.haml +11 -0
  94. data/app/views/admin/tags/destroy.js.haml +10 -0
  95. data/app/views/admin/tags/edit.js.haml +20 -0
  96. data/app/views/admin/tags/new.js.haml +7 -0
  97. data/app/views/admin/tags/update.js.haml +9 -0
  98. data/app/views/admin/users/_edit.html.haml +1 -1
  99. data/app/views/admin/users/_new.html.haml +1 -1
  100. data/app/views/admin/users/_user.html.haml +1 -1
  101. data/app/views/admin/users/confirm.js.haml +7 -0
  102. data/app/views/admin/users/create.js.haml +10 -0
  103. data/app/views/admin/users/destroy.js.haml +10 -0
  104. data/app/views/admin/users/edit.js.haml +20 -0
  105. data/app/views/admin/users/index.js.haml +2 -0
  106. data/app/views/admin/users/new.js.haml +9 -0
  107. data/app/views/admin/users/reactivate.js.haml +3 -0
  108. data/app/views/admin/users/suspend.js.haml +3 -0
  109. data/app/views/admin/users/update.js.haml +9 -0
  110. data/app/views/authentications/new.html.haml +1 -1
  111. data/app/views/campaigns/_edit.html.haml +1 -1
  112. data/app/views/campaigns/_new.html.haml +1 -1
  113. data/app/views/campaigns/create.js.haml +20 -0
  114. data/app/views/campaigns/destroy.js.haml +6 -0
  115. data/app/views/campaigns/edit.js.haml +33 -0
  116. data/app/views/campaigns/index.js.haml +11 -0
  117. data/app/views/campaigns/index.xls.builder +9 -7
  118. data/app/views/campaigns/new.js.haml +11 -0
  119. data/app/views/campaigns/show.js.haml +5 -0
  120. data/app/views/campaigns/update.js.haml +20 -0
  121. data/app/views/comments/_comment.html.haml +1 -1
  122. data/app/views/comments/_edit.html.haml +1 -1
  123. data/app/views/comments/_new.html.haml +3 -2
  124. data/app/views/comments/create.js.haml +14 -0
  125. data/app/views/comments/destroy.js.haml +5 -0
  126. data/app/views/comments/edit.js.haml +11 -0
  127. data/app/views/comments/update.js.haml +9 -0
  128. data/app/views/contacts/_edit.html.haml +1 -1
  129. data/app/views/contacts/_index_full.html.haml +1 -1
  130. data/app/views/contacts/_index_long.html.haml +2 -1
  131. data/app/views/contacts/_new.html.haml +1 -1
  132. data/app/views/contacts/_section_general.html.haml +3 -3
  133. data/app/views/contacts/create.js.haml +23 -0
  134. data/app/views/contacts/destroy.js.haml +9 -0
  135. data/app/views/contacts/edit.js.haml +35 -0
  136. data/app/views/contacts/index.js.haml +11 -0
  137. data/app/views/contacts/index.xls.builder +9 -7
  138. data/app/views/contacts/new.js.haml +13 -0
  139. data/app/views/contacts/show.js.haml +5 -0
  140. data/app/views/contacts/update.js.haml +22 -0
  141. data/app/views/emails/destroy.js.haml +5 -0
  142. data/app/views/entities/_permissions.html.haml +1 -1
  143. data/app/views/entities/attach.js.haml +21 -0
  144. data/app/views/entities/contacts.js.haml +3 -0
  145. data/app/views/entities/discard.js.haml +6 -0
  146. data/app/views/entities/leads.js.haml +3 -0
  147. data/app/views/entities/opportunities.js.haml +3 -0
  148. data/app/views/entities/subscription_update.js.haml +4 -0
  149. data/app/views/entities/versions.js.haml +3 -0
  150. data/app/views/fields/group.js.erb +3 -0
  151. data/app/views/home/_account.html.haml +3 -3
  152. data/app/views/home/_opportunity.html.haml +3 -3
  153. data/app/views/home/index.atom.builder +3 -3
  154. data/app/views/home/index.js.haml +7 -0
  155. data/app/views/home/index.rss.builder +2 -2
  156. data/app/views/home/options.js.haml +7 -0
  157. data/app/views/layouts/_footer.html.haml +0 -4
  158. data/app/views/layouts/_sidebar.html.haml +1 -0
  159. data/app/views/layouts/_tabbed.html.haml +1 -4
  160. data/app/views/layouts/admin/application.html.haml +0 -1
  161. data/app/views/layouts/application.html.haml +5 -7
  162. data/app/views/leads/_convert.html.haml +1 -1
  163. data/app/views/leads/_edit.html.haml +1 -1
  164. data/app/views/leads/_index_long.html.haml +2 -2
  165. data/app/views/leads/_new.html.haml +1 -1
  166. data/app/views/leads/convert.js.haml +35 -0
  167. data/app/views/leads/create.js.haml +21 -0
  168. data/app/views/leads/destroy.js.haml +9 -0
  169. data/app/views/leads/edit.js.haml +35 -0
  170. data/app/views/leads/index.js.haml +11 -0
  171. data/app/views/leads/index.xls.builder +9 -7
  172. data/app/views/leads/new.js.haml +11 -0
  173. data/app/views/leads/promote.js.haml +26 -0
  174. data/app/views/leads/reject.js.haml +12 -0
  175. data/app/views/leads/show.js.haml +5 -0
  176. data/app/views/leads/update.js.haml +26 -0
  177. data/app/views/lists/_personal_sidebar.html.haml +28 -0
  178. data/app/views/lists/_sidebar.html.haml +10 -7
  179. data/app/views/lists/create.js.haml +10 -0
  180. data/app/views/lists/destroy.js.haml +1 -0
  181. data/app/views/opportunities/_edit.html.haml +1 -1
  182. data/app/views/opportunities/_index_brief.html.haml +3 -3
  183. data/app/views/opportunities/_index_long.html.haml +3 -3
  184. data/app/views/opportunities/_new.html.haml +1 -2
  185. data/app/views/opportunities/_top_section.html.haml +4 -0
  186. data/app/views/opportunities/contacts.js.haml +3 -0
  187. data/app/views/opportunities/create.js.haml +29 -0
  188. data/app/views/opportunities/destroy.js.haml +13 -0
  189. data/app/views/opportunities/edit.js.haml +35 -0
  190. data/app/views/opportunities/index.js.haml +11 -0
  191. data/app/views/opportunities/index.xls.builder +9 -7
  192. data/app/views/opportunities/new.js.haml +13 -0
  193. data/app/views/opportunities/show.js.haml +5 -0
  194. data/app/views/opportunities/update.js.haml +25 -0
  195. data/app/views/passwords/edit.html.haml +1 -1
  196. data/app/views/passwords/new.html.haml +1 -1
  197. data/app/views/shared/_comment.html.haml +1 -1
  198. data/app/views/shared/_inline_styles.html.haml +1 -1
  199. data/app/views/tasks/_edit.html.haml +1 -1
  200. data/app/views/tasks/_new.html.haml +1 -1
  201. data/app/views/tasks/complete.js.haml +14 -0
  202. data/app/views/tasks/create.js.haml +39 -0
  203. data/app/views/tasks/destroy.js.haml +7 -0
  204. data/app/views/tasks/discard.js.haml +1 -0
  205. data/app/views/tasks/edit.js.haml +26 -0
  206. data/app/views/tasks/filter.js.haml +4 -0
  207. data/app/views/tasks/index.xls.builder +7 -5
  208. data/app/views/tasks/new.js.haml +8 -0
  209. data/app/views/tasks/update.js.haml +19 -0
  210. data/app/views/users/_password.html.haml +1 -1
  211. data/app/views/users/_profile.html.haml +1 -1
  212. data/app/views/users/avatar.js.haml +9 -0
  213. data/app/views/users/change_password.js.haml +13 -0
  214. data/app/views/users/edit.js.haml +9 -0
  215. data/app/views/users/new.html.haml +1 -1
  216. data/app/views/users/password.js.haml +10 -0
  217. data/app/views/users/update.js.haml +9 -0
  218. data/app/views/users/upload_avatar.js.haml +7 -0
  219. data/app/views/versions/_version.html.haml +1 -1
  220. data/config/application.rb +1 -4
  221. data/config/environments/production.rb +3 -2
  222. data/config/initializers/custom_field_ransack_translations.rb +15 -0
  223. data/config/initializers/locale.rb +9 -1
  224. data/config/initializers/secret_token.rb +1 -25
  225. data/config/initializers/views.rb +20 -20
  226. data/config/locales/cz.yml +245 -211
  227. data/config/locales/cz_fat_free_crm.yml +105 -181
  228. data/config/locales/de.yml +162 -118
  229. data/config/locales/de_fat_free_crm.yml +760 -731
  230. data/config/locales/de_ransack.yml +91 -0
  231. data/config/locales/en-GB.yml +158 -119
  232. data/config/locales/en-GB_fat_free_crm.yml +161 -279
  233. data/config/locales/en-US.yml +158 -121
  234. data/config/locales/en-US_fat_free_crm.yml +185 -179
  235. data/config/locales/en-US_ransack.yml +81 -82
  236. data/config/locales/es.yml +164 -123
  237. data/config/locales/es_fat_free_crm.yml +151 -209
  238. data/config/locales/fr-CA.yml +167 -130
  239. data/config/locales/fr-CA_fat_free_crm.yml +142 -202
  240. data/config/locales/fr.yml +170 -125
  241. data/config/locales/fr_fat_free_crm.yml +199 -302
  242. data/config/locales/it.yml +158 -122
  243. data/config/locales/it_fat_free_crm.yml +105 -168
  244. data/config/locales/ja.yml +162 -131
  245. data/config/locales/ja_fat_free_crm.yml +118 -188
  246. data/config/locales/pl.yml +168 -132
  247. data/config/locales/pl_fat_free_crm.yml +115 -186
  248. data/config/locales/pt-BR.yml +160 -127
  249. data/config/locales/pt-BR_fat_free_crm.yml +125 -182
  250. data/config/locales/ru.yml +256 -233
  251. data/config/locales/ru_fat_free_crm.yml +136 -193
  252. data/config/locales/sv-SE.yml +164 -181
  253. data/config/locales/sv-SE_fat_free_crm.yml +129 -193
  254. data/config/locales/th_fat_free_crm.yml +114 -194
  255. data/config/locales/zh-CN.yml +176 -149
  256. data/config/locales/zh-CN_fat_free_crm.yml +78 -167
  257. data/config/routes.rb +1 -1
  258. data/config/settings.default.yml +74 -23
  259. data/custom_plan.rb +11 -0
  260. data/db/migrate/20131207033244_add_user_id_to_lists.rb +6 -0
  261. data/db/schema.rb +4 -1
  262. data/fat_free_crm.gemspec +3 -3
  263. data/lib/fat_free_crm.rb +1 -11
  264. data/lib/fat_free_crm/export_csv.rb +3 -3
  265. data/lib/fat_free_crm/fields.rb +10 -0
  266. data/lib/fat_free_crm/gem_dependencies.rb +1 -2
  267. data/lib/fat_free_crm/i18n.rb +9 -5
  268. data/lib/fat_free_crm/version.rb +2 -2
  269. data/lib/fat_free_crm/view_factory.rb +8 -5
  270. data/lib/tasks/ffcrm/config.rake +9 -12
  271. data/lib/tasks/ffcrm/missing_translations.rake +2 -1
  272. data/spec/controllers/admin/users_controller_spec.rb +6 -4
  273. data/spec/controllers/applications_controller_spec.rb +4 -4
  274. data/spec/controllers/authentications_controller_spec.rb +15 -15
  275. data/spec/controllers/comments_controller_spec.rb +9 -87
  276. data/spec/controllers/emails_controller_spec.rb +1 -1
  277. data/spec/controllers/entities/accounts_controller_spec.rb +7 -7
  278. data/spec/controllers/entities/campaigns_controller_spec.rb +5 -5
  279. data/spec/controllers/entities/contacts_controller_spec.rb +7 -7
  280. data/spec/controllers/entities/leads_controller_spec.rb +14 -14
  281. data/spec/controllers/entities/opportunities_controller_spec.rb +8 -8
  282. data/spec/controllers/home_controller_spec.rb +6 -6
  283. data/spec/controllers/tasks_controller_spec.rb +7 -7
  284. data/spec/controllers/users_controller_spec.rb +22 -50
  285. data/spec/features/support/selector_helpers.rb +1 -6
  286. data/spec/features/tasks_spec.rb +2 -2
  287. data/spec/helpers/application_helper_spec.rb +15 -15
  288. data/spec/lib/fields_spec.rb +29 -29
  289. data/spec/lib/mail_processor/base_spec.rb +7 -7
  290. data/spec/lib/mail_processor/dropbox_spec.rb +3 -3
  291. data/spec/lib/view_factory_spec.rb +14 -14
  292. data/spec/models/entities/opportunity_spec.rb +1 -1
  293. data/spec/models/fields/custom_field_date_pair_spec.rb +14 -14
  294. data/spec/models/fields/custom_field_pair_spec.rb +13 -13
  295. data/spec/models/fields/custom_field_spec.rb +5 -5
  296. data/spec/models/fields/field_spec.rb +2 -2
  297. data/spec/models/observers/entity_observer_spec.rb +2 -2
  298. data/spec/models/users/user_spec.rb +7 -7
  299. data/spec/routing/comments_routing_spec.rb +0 -9
  300. data/spec/shared/controllers.rb +75 -77
  301. data/spec/shared/models.rb +1 -1
  302. data/spec/spec_helper.rb +1 -2
  303. data/spec/support/auth_macros.rb +3 -3
  304. data/spec/support/mail_processor_mocks.rb +13 -13
  305. data/spec/views/accounts/_edit.haml_spec.rb +1 -1
  306. data/spec/views/accounts/{create.rjs_spec.rb → create.js.haml_spec.rb} +9 -14
  307. data/spec/views/accounts/{destroy.rjs_spec.rb → destroy.js.haml_spec.rb} +6 -8
  308. data/spec/views/accounts/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +10 -18
  309. data/spec/views/accounts/{index.rjs_spec.rb → index.js.haml_spec.rb} +7 -11
  310. data/spec/views/accounts/{new.rjs_spec.rb → new.js.haml_spec.rb} +6 -8
  311. data/spec/views/accounts/show.haml_spec.rb +1 -1
  312. data/spec/views/accounts/{update.rjs_spec.rb → update.js.haml_spec.rb} +16 -25
  313. data/spec/views/admin/field_groups/create.js.haml_spec.rb +31 -0
  314. data/spec/views/admin/field_groups/destroy.js.haml_spec.rb +31 -0
  315. data/spec/views/admin/field_groups/edit.js.haml_spec.rb +24 -0
  316. data/spec/views/admin/field_groups/new.js.haml_spec.rb +25 -0
  317. data/spec/views/admin/field_groups/update.js.haml_spec.rb +30 -0
  318. data/spec/views/admin/users/_create.haml_spec.rb +1 -1
  319. data/spec/views/admin/users/{create.rjs_spec.rb → create.js.haml_spec.rb} +6 -9
  320. data/spec/views/admin/users/{destroy.rjs_spec.rb → destroy.js.haml_spec.rb} +6 -7
  321. data/spec/views/admin/users/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +6 -12
  322. data/spec/views/admin/users/index.haml_spec.rb +0 -0
  323. data/spec/views/admin/users/{index.rjs_spec.rb → index.js.haml_spec.rb} +3 -5
  324. data/spec/views/admin/users/{new.rjs_spec.rb → new.js.haml_spec.rb} +4 -6
  325. data/spec/views/admin/users/{reactivate.rjs_spec.rb → reactivate.js.haml_spec.rb} +2 -4
  326. data/spec/views/admin/users/show.haml_spec.rb +0 -0
  327. data/spec/views/admin/users/{suspend.rjs_spec.rb → suspend.js.haml_spec.rb} +2 -4
  328. data/spec/views/admin/users/{update.rjs_spec.rb → update.js.haml_spec.rb} +6 -10
  329. data/spec/views/campaigns/{create.rjs_spec.rb → create.js.haml_spec.rb} +9 -14
  330. data/spec/views/campaigns/{destroy.rjs_spec.rb → destroy.js.haml_spec.rb} +6 -7
  331. data/spec/views/campaigns/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +11 -19
  332. data/spec/views/campaigns/{index.rjs_spec.rb → index.js.haml_spec.rb} +5 -9
  333. data/spec/views/campaigns/{new.rjs_spec.rb → new.js.haml_spec.rb} +6 -8
  334. data/spec/views/campaigns/{update.rjs_spec.rb → update.js.haml_spec.rb} +14 -21
  335. data/spec/views/comments/{new.rjs_spec.rb → edit.js.haml_spec.rb} +12 -9
  336. data/spec/views/contacts/{create.rjs_spec.rb → create.js.haml_spec.rb} +9 -16
  337. data/spec/views/contacts/{destroy.rjs_spec.rb → destroy.js.haml_spec.rb} +6 -8
  338. data/spec/views/contacts/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +12 -19
  339. data/spec/views/contacts/index.haml_spec.rb +1 -1
  340. data/spec/views/contacts/{index.rjs_spec.rb → index.js.html_spec.rb} +7 -11
  341. data/spec/views/contacts/{new.rjs_spec.rb → new.js.haml_spec.rb} +6 -7
  342. data/spec/views/contacts/{update.rjs_spec.rb → update.js.haml_spec.rb} +20 -35
  343. data/spec/views/home/{index.rjs_spec.rb → index.js.haml_spec.rb} +2 -4
  344. data/spec/views/home/{options.rjs_spec.rb → options.js.haml_spec.rb} +7 -12
  345. data/spec/views/leads/{convert.rjs_spec.rb → convert.js.haml_spec.rb} +12 -20
  346. data/spec/views/leads/{create.rjs_spec.rb → create.js.haml_spec.rb} +13 -19
  347. data/spec/views/leads/{destroy.rjs_spec.rb → destroy.js.haml_spec.rb} +9 -12
  348. data/spec/views/leads/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +12 -20
  349. data/spec/views/leads/{index.rjs_spec.rb → index.js.haml_spec.rb} +5 -9
  350. data/spec/views/leads/{new.rjs_spec.rb → new.js.haml_spec.rb} +6 -8
  351. data/spec/views/leads/{promote.rjs_spec.rb → promote.js.haml_spec.rb} +28 -43
  352. data/spec/views/leads/{reject.rjs_spec.rb → reject.js.haml_spec.rb} +10 -17
  353. data/spec/views/leads/{update.rjs_spec.rb → update.js.haml_spec.rb} +25 -38
  354. data/spec/views/opportunities/{create.rjs_spec.rb → create.js.haml_spec.rb} +16 -26
  355. data/spec/views/opportunities/{destroy.rjs_spec.rb → destroy.js.haml_spec.rb} +13 -16
  356. data/spec/views/opportunities/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +10 -18
  357. data/spec/views/opportunities/{index.rjs_spec.rb → index.js.haml_spec.rb} +7 -12
  358. data/spec/views/opportunities/{new.rjs_spec.rb → new.js.haml_spec.rb} +6 -8
  359. data/spec/views/opportunities/{update.rjs_spec.rb → update.js.haml_spec.rb} +29 -46
  360. data/spec/views/tasks/_edit.haml_spec.rb +1 -1
  361. data/spec/views/tasks/{complete.rjs_spec.rb → complete.js.haml_spec.rb} +9 -14
  362. data/spec/views/tasks/{create.rjs_spec.rb → create.js.haml_spec.rb} +25 -33
  363. data/spec/views/tasks/{destroy.rjs_spec.rb → destroy.js.haml_spec.rb} +9 -11
  364. data/spec/views/tasks/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +9 -14
  365. data/spec/views/tasks/index.haml_spec.rb +1 -2
  366. data/spec/views/tasks/{new.rjs_spec.rb → new.js.haml_spec.rb} +6 -8
  367. data/spec/views/tasks/{update.rjs_spec.rb → update.js.haml_spec.rb} +28 -41
  368. data/spec/views/users/{avatar.rjs_spec.rb → avatar.js.haml_spec.rb} +7 -9
  369. data/spec/views/users/{change_password.rjs_spec.rb → change_password.js.haml_spec.rb} +10 -12
  370. data/spec/views/users/{edit.rjs_spec.rb → edit.js.haml_spec.rb} +8 -10
  371. data/spec/views/users/{password.rjs_spec.rb → password.js.haml_spec.rb} +9 -11
  372. data/spec/views/users/{update.rjs_spec.rb → update.js.haml_spec.rb} +7 -15
  373. data/spec/views/users/{upload_avatar.rjs_spec.rb → upload_avatar.js.haml_spec.rb} +8 -10
  374. data/vendor/assets/javascripts/ajax-chosen-jquery.js +2 -0
  375. data/vendor/assets/javascripts/ajax-chosen-prototype.js +2 -0
  376. data/vendor/assets/javascripts/ajax-chosen.jquery.coffee +81 -0
  377. data/vendor/assets/javascripts/ajax-chosen.proto.coffee +98 -0
  378. data/vendor/assets/javascripts/jquery_timeago/index.js +17 -0
  379. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.cz.js +18 -0
  380. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.de.js +18 -0
  381. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.en-GB.js +20 -0
  382. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.en-US.js +20 -0
  383. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.es.js +18 -0
  384. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.fr-CA.js +17 -0
  385. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.fr.js +17 -0
  386. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.it.js +16 -0
  387. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.ja.js +19 -0
  388. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.js +194 -0
  389. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.pl.js +31 -0
  390. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.pt-BR.js +18 -0
  391. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.ru.js +34 -0
  392. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.sv-SE.js +18 -0
  393. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.th.js +20 -0
  394. data/vendor/assets/javascripts/jquery_timeago/jquery.timeago.zh-CN.js +20 -0
  395. data/zeus.json +2 -1
  396. metadata +240 -245
  397. data/app/assets/images/delete.png +0 -0
  398. data/app/assets/images/iconset_attribution.png +0 -0
  399. data/app/views/accounts/create.js.rjs +0 -14
  400. data/app/views/accounts/destroy.js.rjs +0 -3
  401. data/app/views/accounts/edit.js.rjs +0 -33
  402. data/app/views/accounts/index.js.rjs +0 -8
  403. data/app/views/accounts/new.js.rjs +0 -9
  404. data/app/views/accounts/show.js.erb +0 -2
  405. data/app/views/accounts/update.js.rjs +0 -17
  406. data/app/views/admin/field_groups/confirm.js.rjs +0 -6
  407. data/app/views/admin/field_groups/create.js.rjs +0 -20
  408. data/app/views/admin/field_groups/destroy.js.rjs +0 -11
  409. data/app/views/admin/field_groups/edit.js.rjs +0 -14
  410. data/app/views/admin/field_groups/new.js.rjs +0 -9
  411. data/app/views/admin/field_groups/update.js.rjs +0 -9
  412. data/app/views/admin/fields/create.js.erb +0 -19
  413. data/app/views/admin/fields/destroy.js.erb +0 -9
  414. data/app/views/admin/fields/edit.js.erb +0 -1
  415. data/app/views/admin/fields/update.js.erb +0 -13
  416. data/app/views/admin/groups/create.js.rjs +0 -11
  417. data/app/views/admin/groups/destroy.js.rjs +0 -11
  418. data/app/views/admin/groups/edit.js.rjs +0 -21
  419. data/app/views/admin/groups/index.js.rjs +0 -2
  420. data/app/views/admin/groups/new.js.rjs +0 -9
  421. data/app/views/admin/groups/update.js.rjs +0 -10
  422. data/app/views/admin/tags/confirm.js.rjs +0 -6
  423. data/app/views/admin/tags/create.js.rjs +0 -12
  424. data/app/views/admin/tags/destroy.js.rjs +0 -11
  425. data/app/views/admin/tags/edit.js.rjs +0 -21
  426. data/app/views/admin/tags/new.js.rjs +0 -8
  427. data/app/views/admin/tags/update.js.rjs +0 -10
  428. data/app/views/admin/users/confirm.js.rjs +0 -6
  429. data/app/views/admin/users/create.js.rjs +0 -11
  430. data/app/views/admin/users/destroy.js.rjs +0 -11
  431. data/app/views/admin/users/edit.js.rjs +0 -21
  432. data/app/views/admin/users/index.js.rjs +0 -3
  433. data/app/views/admin/users/new.js.rjs +0 -8
  434. data/app/views/admin/users/reactivate.js.rjs +0 -3
  435. data/app/views/admin/users/suspend.js.rjs +0 -3
  436. data/app/views/admin/users/update.js.rjs +0 -10
  437. data/app/views/campaigns/create.js.rjs +0 -18
  438. data/app/views/campaigns/destroy.js.rjs +0 -3
  439. data/app/views/campaigns/edit.js.rjs +0 -34
  440. data/app/views/campaigns/index.js.rjs +0 -8
  441. data/app/views/campaigns/new.js.rjs +0 -9
  442. data/app/views/campaigns/show.js.erb +0 -2
  443. data/app/views/campaigns/update.js.rjs +0 -21
  444. data/app/views/comments/create.js.rjs +0 -11
  445. data/app/views/comments/destroy.js.rjs +0 -6
  446. data/app/views/comments/edit.js.rjs +0 -11
  447. data/app/views/comments/new.js.rjs +0 -14
  448. data/app/views/comments/update.js.rjs +0 -11
  449. data/app/views/contacts/create.js.rjs +0 -19
  450. data/app/views/contacts/destroy.js.rjs +0 -7
  451. data/app/views/contacts/edit.js.rjs +0 -36
  452. data/app/views/contacts/index.js.rjs +0 -8
  453. data/app/views/contacts/new.js.rjs +0 -11
  454. data/app/views/contacts/show.js.erb +0 -2
  455. data/app/views/contacts/update.js.rjs +0 -22
  456. data/app/views/emails/destroy.js.rjs +0 -6
  457. data/app/views/entities/attach.js.rjs +0 -24
  458. data/app/views/entities/contacts.js.rjs +0 -3
  459. data/app/views/entities/discard.js.rjs +0 -7
  460. data/app/views/entities/leads.js.rjs +0 -3
  461. data/app/views/entities/opportunities.js.rjs +0 -3
  462. data/app/views/entities/subscription_update.js.rjs +0 -4
  463. data/app/views/entities/versions.js.erb +0 -3
  464. data/app/views/fields/group.js.rjs +0 -7
  465. data/app/views/home/index.js.rjs +0 -7
  466. data/app/views/home/options.js.rjs +0 -8
  467. data/app/views/leads/convert.js.rjs +0 -37
  468. data/app/views/leads/create.js.rjs +0 -19
  469. data/app/views/leads/destroy.js.rjs +0 -7
  470. data/app/views/leads/edit.js.rjs +0 -36
  471. data/app/views/leads/index.js.rjs +0 -8
  472. data/app/views/leads/new.js.rjs +0 -9
  473. data/app/views/leads/promote.js.rjs +0 -27
  474. data/app/views/leads/reject.js.rjs +0 -10
  475. data/app/views/leads/show.js.erb +0 -2
  476. data/app/views/leads/update.js.rjs +0 -27
  477. data/app/views/lists/create.js.rjs +0 -9
  478. data/app/views/lists/destroy.js.rjs +0 -1
  479. data/app/views/opportunities/contacts.js.rjs +0 -3
  480. data/app/views/opportunities/create.js.rjs +0 -29
  481. data/app/views/opportunities/destroy.js.rjs +0 -11
  482. data/app/views/opportunities/edit.js.rjs +0 -36
  483. data/app/views/opportunities/index.js.rjs +0 -8
  484. data/app/views/opportunities/new.js.rjs +0 -12
  485. data/app/views/opportunities/show.js.erb +0 -2
  486. data/app/views/opportunities/update.js.rjs +0 -26
  487. data/app/views/tasks/complete.js.rjs +0 -17
  488. data/app/views/tasks/create.js.rjs +0 -41
  489. data/app/views/tasks/destroy.js.rjs +0 -7
  490. data/app/views/tasks/discard.rjs +0 -1
  491. data/app/views/tasks/edit.js.rjs +0 -23
  492. data/app/views/tasks/filter.js.rjs +0 -1
  493. data/app/views/tasks/new.js.rjs +0 -9
  494. data/app/views/tasks/update.js.rjs +0 -21
  495. data/app/views/users/avatar.js.rjs +0 -10
  496. data/app/views/users/change_password.js.rjs +0 -15
  497. data/app/views/users/edit.js.rjs +0 -10
  498. data/app/views/users/password.js.rjs +0 -11
  499. data/app/views/users/update.js.rjs +0 -10
  500. data/app/views/users/upload_avatar.js.rjs +0 -8
  501. data/lib/fat_free_crm/secret_token_generator.rb +0 -65
  502. data/spec/lib/secret_token_generator_spec.rb +0 -79
  503. data/spec/models/users/abilities/user_ability_spec.rb +0 -58
  504. data/spec/support/rjs_support.rb +0 -14
  505. data/vendor/assets/images/brief.png +0 -0
  506. data/vendor/assets/images/full.png +0 -0
  507. data/vendor/assets/images/long.png +0 -0
  508. data/vendor/assets/images/tab_icons/accounts.png +0 -0
  509. data/vendor/assets/images/tab_icons/accounts_active.png +0 -0
  510. data/vendor/assets/images/tab_icons/campaigns.png +0 -0
  511. data/vendor/assets/images/tab_icons/campaigns_active.png +0 -0
  512. data/vendor/assets/images/tab_icons/contacts.png +0 -0
  513. data/vendor/assets/images/tab_icons/contacts_active.png +0 -0
  514. data/vendor/assets/images/tab_icons/dashboard.png +0 -0
  515. data/vendor/assets/images/tab_icons/dashboard_active.png +0 -0
  516. data/vendor/assets/images/tab_icons/leads.png +0 -0
  517. data/vendor/assets/images/tab_icons/leads_active.png +0 -0
  518. data/vendor/assets/images/tab_icons/opportunities.png +0 -0
  519. data/vendor/assets/images/tab_icons/opportunities_active.png +0 -0
  520. data/vendor/assets/images/tab_icons/tasks.png +0 -0
  521. data/vendor/assets/images/tab_icons/tasks_active.png +0 -0
@@ -21,15 +21,10 @@ describe "/home/options" do
21
21
 
22
22
  render
23
23
 
24
- rendered.should have_rjs("options") do |rjs|
25
- with_tag("input[type=hidden]") # current_user
26
-
27
- user_menu = "onLoading:function(request){$('user').update('all users'); " +
28
- "$('loading').show()}, parameters:'user=all_users'}); } } }"
29
- with_tag("script", /#{Regexp.escape(user_menu)}/)
30
- end
31
- rendered.should include('crm.flip_form("options")')
32
- rendered.should include('crm.set_title("title", "Recent Activity Options")')
24
+ rendered.should include("jQuery('#options').html")
25
+ rendered.should include("onLoading:function(request){$(\\'asset\\').update(\\'campaign\\'); $(\\'loading\\').show()}")
26
+ rendered.should include("crm.flip_form('options')")
27
+ rendered.should include("crm.set_title('title', 'Recent Activity Options')")
33
28
  end
34
29
 
35
30
  it "should load :options partial with JavaScript code for menus" do
@@ -49,8 +44,8 @@ describe "/home/options" do
49
44
  params[:cancel] = "true"
50
45
  render
51
46
 
52
- rendered.should_not have_rjs("options")
53
- rendered.should include('crm.flip_form("options")')
54
- rendered.should include('crm.set_title("title", "Recent Activity")')
47
+ rendered.should_not include("jQuery('#options').html")
48
+ rendered.should include("crm.flip_form('options')")
49
+ rendered.should include("crm.set_title('title', 'Recent Activity')")
55
50
  end
56
51
  end
@@ -3,7 +3,7 @@
3
3
  # Fat Free CRM is freely distributable under the terms of MIT license.
4
4
  # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
5
5
  #------------------------------------------------------------------------------
6
- require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
6
+ require 'spec_helper'
7
7
 
8
8
  describe "/leads/convert" do
9
9
  include LeadsHelper
@@ -22,9 +22,7 @@ describe "/leads/convert" do
22
22
  params[:cancel] = "true"
23
23
 
24
24
  render
25
- rendered.should have_rjs("lead_#{@lead.id}") do |rjs|
26
- with_tag("li[id=lead_#{@lead.id}]")
27
- end
25
+ rendered.should include("jQuery('#lead_#{@lead.id}').replaceWith('<li class=\\'highlight lead\\' id=\\'lead_#{@lead.id}\\'")
28
26
  end
29
27
 
30
28
  it "cancel from lead landing page: should hide [Convert Lead] form" do
@@ -32,7 +30,7 @@ describe "/leads/convert" do
32
30
  params[:cancel] = "true"
33
31
 
34
32
  render
35
- rendered.should include('crm.flip_form("convert_lead"')
33
+ rendered.should include("crm.flip_form('convert_lead'")
36
34
  end
37
35
 
38
36
  it "convert: should hide previously open [Convert Lead] and replace it with lead partial" do
@@ -40,9 +38,7 @@ describe "/leads/convert" do
40
38
  assign(:previous, previous = FactoryGirl.create(:lead, :user => current_user))
41
39
 
42
40
  render
43
- rendered.should have_rjs("lead_#{previous.id}") do |rjs|
44
- with_tag("li[id=lead_#{previous.id}]")
45
- end
41
+ rendered.should include("jQuery('#lead_#{previous.id}').replaceWith")
46
42
  end
47
43
 
48
44
  it "convert: should remove previously open [Convert Lead] if it's no longer available" do
@@ -50,29 +46,25 @@ describe "/leads/convert" do
50
46
  assign(:previous, previous = 41)
51
47
 
52
48
  render
53
- rendered.should include(%Q/crm.flick("lead_#{previous}", "remove");/)
49
+ rendered.should include("crm.flick('lead_#{previous}', 'remove');")
54
50
  end
55
51
 
56
52
  it "convert from leads index page: should turn off highlight, hide [Create Lead] form, and replace current lead with [Convert Lead] form" do
57
53
  params[:cancel] = nil
58
54
 
59
55
  render
60
- rendered.should include(%Q/crm.highlight_off("lead_#{@lead.id}");/)
61
- rendered.should include('crm.hide_form("create_lead")')
62
- rendered.should have_rjs("lead_#{@lead.id}") do |rjs|
63
- with_tag("form[class=edit_lead]")
64
- end
56
+ rendered.should include("crm.highlight_off('lead_#{@lead.id}');")
57
+ rendered.should include("crm.hide_form('create_lead')")
58
+ rendered.should include("jQuery('#lead_#{@lead.id}').html")
65
59
  end
66
60
 
67
61
  it "convert from lead landing page: should hide [Edit Lead] and show [Convert Lead] form" do
68
62
  params[:cancel] = "false"
69
63
 
70
64
  render
71
- rendered.should have_rjs("convert_lead") do |rjs|
72
- with_tag("form[class=edit_lead]")
73
- end
74
- rendered.should include('crm.hide_form("edit_lead"')
75
- rendered.should include('crm.flip_form("convert_lead"')
65
+ rendered.should include("#convert_lead")
66
+ rendered.should include("crm.hide_form('edit_lead'")
67
+ rendered.should include("crm.flip_form('convert_lead'")
76
68
  end
77
69
 
78
70
  it "convert: should handle new or existing account and set up calendar field" do
@@ -80,7 +72,7 @@ describe "/leads/convert" do
80
72
 
81
73
  render
82
74
  rendered.should include("crm.create_or_select_account")
83
- rendered.should include('$("account_name").focus()')
75
+ rendered.should include('focus()')
84
76
  end
85
77
 
86
78
  end
@@ -3,7 +3,7 @@
3
3
  # Fat Free CRM is freely distributable under the terms of MIT license.
4
4
  # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
5
5
  #------------------------------------------------------------------------------
6
- require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
6
+ require 'spec_helper'
7
7
 
8
8
  describe "/leads/create" do
9
9
  before do
@@ -22,28 +22,25 @@ describe "/leads/create" do
22
22
  it "should hide [Create Lead] form and insert lead partial" do
23
23
  render
24
24
 
25
- rendered.should have_rjs(:insert, :top) do |rjs|
26
- with_tag("li[id=lead_#{@lead.id}]")
27
- end
28
- rendered.should include(%Q/$("lead_#{@lead.id}").visualEffect("highlight"/)
25
+ rendered.should include("jQuery('#leads').prepend('<li class=\\'highlight lead\\' id=\\'lead_#{@lead.id}\\'")
26
+ rendered.should include(%Q/jQuery('#lead_#{@lead.id}').effect("highlight"/)
29
27
  end
30
28
 
31
29
  it "should update sidebar when called from leads index" do
32
30
  controller.request.env["HTTP_REFERER"] = "http://localhost/leads"
33
31
  render
34
32
 
35
- rendered.should have_rjs("sidebar") do |rjs|
36
- with_tag("div[id=filters]")
37
- with_tag("div[id=recently]")
38
- end
39
- rendered.should include('$("filters").visualEffect("shake"')
33
+ rendered.should include("#sidebar")
34
+ rendered.should have_text("Lead Statuses")
35
+ rendered.should include("Recent Items")
36
+ rendered.should include("jQuery('#filters').effect('shake'")
40
37
  end
41
38
 
42
39
  it "should update pagination when called from leads index" do
43
40
  controller.request.env["HTTP_REFERER"] = "http://localhost/leads"
44
41
  render
45
42
 
46
- rendered.should have_rjs("paginate")
43
+ rendered.should include("#paginate")
47
44
  end
48
45
 
49
46
  it "should update related asset sidebar from related asset" do
@@ -51,10 +48,9 @@ describe "/leads/create" do
51
48
  controller.request.env["HTTP_REFERER"] = "http://localhost/campaigns/#{campaign.id}"
52
49
  render
53
50
 
54
- rendered.should have_rjs("sidebar") do |rjs|
55
- with_tag("div[class=panel][id=summary]")
56
- with_tag("div[class=panel][id=recently]")
57
- end
51
+ rendered.should include("#sidebar")
52
+ rendered.should have_text("Campaign Summary")
53
+ rendered.should have_text("Recent Items")
58
54
  end
59
55
  end
60
56
 
@@ -65,10 +61,8 @@ describe "/leads/create" do
65
61
 
66
62
  render
67
63
 
68
- rendered.should have_rjs("create_lead") do |rjs|
69
- with_tag("form[class=new_lead]")
70
- end
71
- rendered.should include('$("create_lead").visualEffect("shake"')
64
+ rendered.should include("jQuery('#create_lead').html")
65
+ rendered.should include(%Q/jQuery('#create_lead').effect("shake"/)
72
66
  end
73
67
  end
74
68
  end
@@ -3,7 +3,7 @@
3
3
  # Fat Free CRM is freely distributable under the terms of MIT license.
4
4
  # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
5
5
  #------------------------------------------------------------------------------
6
- require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
6
+ require 'spec_helper'
7
7
 
8
8
  describe "/leads/destroy" do
9
9
  before do
@@ -14,7 +14,7 @@ describe "/leads/destroy" do
14
14
 
15
15
  it "should blind up destroyed lead partial" do
16
16
  render
17
- rendered.should include(%Q/$("lead_#{@lead.id}").visualEffect("blind_up"/)
17
+ rendered.should include("slideUp")
18
18
  end
19
19
 
20
20
  it "should update leads sidebar when called from leads index" do
@@ -22,10 +22,9 @@ describe "/leads/destroy" do
22
22
  controller.request.env["HTTP_REFERER"] = "http://localhost/leads"
23
23
  render
24
24
 
25
- rendered.should have_rjs("sidebar") do |rjs|
26
- with_tag("div[id=recently]")
27
- end
28
- rendered.should include('$("filters").visualEffect("shake"')
25
+ rendered.should include("#sidebar")
26
+ rendered.should have_text("Recent Items")
27
+ rendered.should include("jQuery('#filters').effect('shake'")
29
28
  end
30
29
 
31
30
  it "should update pagination when called from leads index" do
@@ -33,7 +32,7 @@ describe "/leads/destroy" do
33
32
  controller.request.env["HTTP_REFERER"] = "http://localhost/leads"
34
33
  render
35
34
 
36
- rendered.should have_rjs("paginate")
35
+ rendered.should include("#paginate")
37
36
  end
38
37
 
39
38
  it "should update related asset sidebar when called from related asset" do
@@ -41,11 +40,9 @@ describe "/leads/destroy" do
41
40
  controller.request.env["HTTP_REFERER"] = "http://localhost/campaigns/#{campaign.id}"
42
41
  render
43
42
 
44
- rendered.should have_rjs("sidebar") do |rjs|
45
- with_tag("div[class=panel][id=summary]")
46
- with_tag("div[class=panel][id=recently]")
47
- end
43
+ rendered.should include("#sidebar")
44
+ rendered.should have_text("Campaign Summary")
45
+ rendered.should have_text("Recent Items")
48
46
  end
49
47
 
50
48
  end
51
-
@@ -3,7 +3,7 @@
3
3
  # Fat Free CRM is freely distributable under the terms of MIT license.
4
4
  # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
5
5
  #------------------------------------------------------------------------------
6
- require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
6
+ require 'spec_helper'
7
7
 
8
8
  describe "/leads/edit" do
9
9
  include LeadsHelper
@@ -19,9 +19,7 @@ describe "/leads/edit" do
19
19
  params[:cancel] = "true"
20
20
 
21
21
  render
22
- rendered.should have_rjs("lead_#{@lead.id}") do |rjs|
23
- with_tag("li[id=lead_#{@lead.id}]")
24
- end
22
+ rendered.should include("jQuery('#lead_#{@lead.id}').replaceWith('<li class=\\'highlight lead\\' id=\\'lead_#{@lead.id}\\'")
25
23
  end
26
24
 
27
25
  it "cancel from lead landing page: should hide [Edit Lead] form" do
@@ -29,7 +27,7 @@ describe "/leads/edit" do
29
27
  params[:cancel] = "true"
30
28
 
31
29
  render
32
- rendered.should include('crm.flip_form("edit_lead"')
30
+ rendered.should include("crm.flip_form('edit_lead'")
33
31
  end
34
32
 
35
33
  it "edit: should hide previously open [Edit Lead] and replace it with lead partial" do
@@ -37,9 +35,7 @@ describe "/leads/edit" do
37
35
  assign(:previous, previous = FactoryGirl.create(:lead, :user => current_user))
38
36
 
39
37
  render
40
- rendered.should have_rjs("lead_#{previous.id}") do |rjs|
41
- with_tag("li[id=lead_#{previous.id}]")
42
- end
38
+ rendered.should include("jQuery('#lead_#{previous.id}').replaceWith('<li class=\\'highlight lead\\' id=\\'lead_#{previous.id}\\'")
43
39
  end
44
40
 
45
41
  it "edit: should remove previously open [Edit Lead] if it's no longer available" do
@@ -47,29 +43,25 @@ describe "/leads/edit" do
47
43
  assign(:previous, previous = 41)
48
44
 
49
45
  render
50
- rendered.should include(%Q/crm.flick("lead_#{previous}", "remove");/)
46
+ rendered.should include("crm.flick('lead_#{previous}', 'remove');")
51
47
  end
52
48
 
53
49
  it "edit from leads index page: should turn off highlight, hide [Create Lead] form, and replace current lead with [Edit Lead] form" do
54
50
  params[:cancel] = nil
55
51
 
56
52
  render
57
- rendered.should include(%Q/crm.highlight_off("lead_#{@lead.id}");/)
58
- rendered.should include('crm.hide_form("create_lead")')
59
- rendered.should have_rjs("lead_#{@lead.id}") do |rjs|
60
- with_tag("form[class=edit_lead]")
61
- end
53
+ rendered.should include("crm.highlight_off('lead_#{@lead.id}');")
54
+ rendered.should include("crm.hide_form('create_lead')")
55
+ rendered.should include("jQuery('#lead_#{@lead.id}').html")
62
56
  end
63
57
 
64
58
  it "edit from lead landing page: should hide [Convert Lead] and show [Edit Lead] form" do
65
59
  params[:cancel] = "false"
66
60
 
67
61
  render
68
- rendered.should have_rjs("edit_lead") do |rjs|
69
- with_tag("form[class=edit_lead]")
70
- end
71
- rendered.should include('crm.hide_form("convert_lead"')
72
- rendered.should include('crm.flip_form("edit_lead"')
62
+ rendered.should include("jQuery('#edit_lead').html")
63
+ rendered.should include("crm.hide_form('convert_lead'")
64
+ rendered.should include("crm.flip_form('edit_lead'")
73
65
  end
74
66
 
75
67
  it "edit from lead landing page: should not attempt to hide [Convert Lead] if the lead is already converted" do
@@ -77,7 +69,7 @@ describe "/leads/edit" do
77
69
  assign(:lead, FactoryGirl.create(:lead, :status => "converted", :user => current_user))
78
70
 
79
71
  render
80
- rendered.should_not include('crm.hide_form("convert_lead"')
72
+ rendered.should_not include("crm.hide_form('convert_lead'")
81
73
  end
82
74
 
83
75
  end
@@ -3,7 +3,7 @@
3
3
  # Fat Free CRM is freely distributable under the terms of MIT license.
4
4
  # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
5
5
  #------------------------------------------------------------------------------
6
- require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
6
+ require 'spec_helper'
7
7
 
8
8
  describe "/leads/index" do
9
9
  include LeadsHelper
@@ -17,10 +17,8 @@ describe "/leads/index" do
17
17
 
18
18
  render :template => 'leads/index', :formats => [:js]
19
19
 
20
- rendered.should have_rjs("leads") do |rjs|
21
- with_tag("li[id=lead_#{42}]")
22
- end
23
- rendered.should have_rjs("paginate")
20
+ rendered.should include("jQuery('#leads').html('<li class=\\'highlight lead\\' id=\\'lead_42\\'")
21
+ rendered.should include("#paginate")
24
22
  end
25
23
 
26
24
  it "should render [empty] template if @leads collection if there are no leads" do
@@ -28,10 +26,8 @@ describe "/leads/index" do
28
26
 
29
27
  render :template => 'leads/index', :formats => [:js]
30
28
 
31
- rendered.should have_rjs("leads") do |rjs|
32
- with_tag("div[id=empty]")
33
- end
34
- rendered.should have_rjs("paginate")
29
+ rendered.should include("jQuery('#leads').html('<div id=\\'empty\\'>")
30
+ rendered.should include("#paginate")
35
31
  end
36
32
 
37
33
  end
@@ -3,7 +3,7 @@
3
3
  # Fat Free CRM is freely distributable under the terms of MIT license.
4
4
  # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
5
5
  #------------------------------------------------------------------------------
6
- require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
6
+ require 'spec_helper'
7
7
 
8
8
  describe "/leads/new" do
9
9
  include LeadsHelper
@@ -20,7 +20,7 @@ describe "/leads/new" do
20
20
  it "should toggle empty message div if it exists" do
21
21
  render
22
22
 
23
- rendered.should include('crm.flick("empty", "toggle")')
23
+ rendered.should include("crm.flick('empty', 'toggle')")
24
24
  end
25
25
 
26
26
  describe "new lead" do
@@ -28,10 +28,8 @@ describe "/leads/new" do
28
28
  params[:cancel] = nil
29
29
  render
30
30
 
31
- rendered.should have_rjs("create_lead") do |rjs|
32
- with_tag("form[class=new_lead]")
33
- end
34
- rendered.should include('crm.flip_form("create_lead")')
31
+ rendered.should include("jQuery('#create_lead').html")
32
+ rendered.should include("crm.flip_form('create_lead')")
35
33
  end
36
34
  end
37
35
 
@@ -40,8 +38,8 @@ describe "/leads/new" do
40
38
  params[:cancel] = "true"
41
39
  render
42
40
 
43
- rendered.should_not have_rjs("create_lead")
44
- rendered.should include('crm.flip_form("create_lead");')
41
+ rendered.should_not include("#create_lead")
42
+ rendered.should include("crm.flip_form('create_lead');")
45
43
  end
46
44
  end
47
45
 
@@ -3,7 +3,7 @@
3
3
  # Fat Free CRM is freely distributable under the terms of MIT license.
4
4
  # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
5
5
  #------------------------------------------------------------------------------
6
- require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
6
+ require 'spec_helper'
7
7
 
8
8
  describe "/leads/promote" do
9
9
  before do
@@ -28,17 +28,16 @@ describe "/leads/promote" do
28
28
 
29
29
  it "should flip [Convert Lead] form" do
30
30
  render
31
- rendered.should_not have_rjs("lead_#{@lead.id}")
32
- rendered.should include('crm.flip_form("convert_lead"')
31
+ rendered.should_not include("lead_#{@lead.id}")
32
+ rendered.should include("crm.flip_form('convert_lead'")
33
33
  end
34
34
 
35
35
  it "should update sidebar" do
36
36
  render
37
- rendered.should have_rjs("sidebar") do |rjs|
38
- with_tag("div[id=summary]")
39
- with_tag("div[id=recently]")
40
- end
41
- rendered.should include('$("summary").visualEffect("shake"')
37
+ rendered.should include("#sidebar")
38
+ rendered.should have_text("Lead Summary")
39
+ rendered.should have_text("Recent Items")
40
+ rendered.should include("jQuery('#summary').effect('shake'")
42
41
  end
43
42
  end
44
43
 
@@ -47,21 +46,18 @@ describe "/leads/promote" do
47
46
  controller.request.env["HTTP_REFERER"] = "http://localhost/leads"
48
47
  end
49
48
 
50
- it "should replace [Convert Lead] with lead partial and highligh it" do
49
+ it "should replace [Convert Lead] with lead partial and highlight it" do
51
50
  render
52
- rendered.should have_rjs("lead_#{@lead.id}") do |rjs|
53
- with_tag("li[id=lead_#{@lead.id}]")
54
- end
55
- rendered.should include(%Q/$("lead_#{@lead.id}").visualEffect("highlight"/)
51
+ rendered.should include("jQuery('#lead_#{@lead.id}').replaceWith('<li class=\\'highlight lead\\' id=\\'lead_#{@lead.id}\\'")
52
+ rendered.should include("jQuery('#filters').effect('shake'")
56
53
  end
57
54
 
58
55
  it "should update sidebar" do
59
56
  render
60
- rendered.should have_rjs("sidebar") do |rjs|
61
- with_tag("div[id=filters]")
62
- with_tag("div[id=recently]")
63
- end
64
- rendered.should include('$("filters").visualEffect("shake"')
57
+ rendered.should include("#sidebar")
58
+ rendered.should have_text("Lead Status")
59
+ rendered.should have_text("Recent Items")
60
+ rendered.should include("jQuery('#filters').effect('shake'")
65
61
  end
66
62
  end
67
63
 
@@ -73,29 +69,24 @@ describe "/leads/promote" do
73
69
  assign(:opportunity, @opportunity = FactoryGirl.create(:opportunity))
74
70
  end
75
71
 
76
- it "should replace [Convert Lead] with lead partial and highligh it" do
72
+ it "should replace [Convert Lead] with lead partial and highlight it" do
77
73
  render
78
- rendered.should have_rjs("lead_#{@lead.id}") do |rjs|
79
- with_tag("li[id=lead_#{@lead.id}]")
80
- end
81
- rendered.should include(%Q/$("lead_#{@lead.id}").visualEffect("highlight"/)
74
+ rendered.should include("jQuery('#lead_#{@lead.id}').replaceWith('<li class=\\'highlight lead\\' id=\\'lead_#{@lead.id}\\'")
75
+ rendered.should include(%Q/jQuery('#lead_#{@lead.id}').effect("highlight"/)
82
76
  end
83
77
 
84
78
  it "should update campaign sidebar" do
85
79
  render
86
80
 
87
- rendered.should have_rjs("sidebar") do |rjs|
88
- with_tag("div[class=panel][id=summary]")
89
- with_tag("div[class=panel][id=recently]")
90
- end
81
+ rendered.should include("#sidebar")
82
+ rendered.should have_text("Summary")
83
+ rendered.should have_text("Recent Items")
91
84
  end
92
85
 
93
86
  it "should insert new opportunity if any" do
94
87
  render
95
88
 
96
- rendered.should have_rjs(:insert, :top) do |rjs|
97
- with_tag("li[id=opportunity_#{@opportunity.id}]")
98
- end
89
+ rendered.should include("jQuery('#opportunities').prepend('<li class=\\'highlight opportunity\\' id=\\'opportunity_#{@opportunity.id}")
99
90
  end
100
91
 
101
92
  end
@@ -113,10 +104,8 @@ describe "/leads/promote" do
113
104
 
114
105
  it "should redraw the [Convert Lead] form and shake it" do
115
106
  render
116
- rendered.should have_rjs("convert_lead") do |rjs|
117
- with_tag("form[class=edit_lead]")
118
- end
119
- rendered.should include(%Q/$("convert_lead").visualEffect("shake"/)
107
+ rendered.should include("jQuery('#convert_lead').html")
108
+ rendered.should include(%Q/jQuery('#convert_lead').effect("shake"/)
120
109
  end
121
110
  end
122
111
 
@@ -127,10 +116,8 @@ describe "/leads/promote" do
127
116
 
128
117
  it "should redraw the [Convert Lead] form and shake it" do
129
118
  render
130
- rendered.should have_rjs("lead_#{@lead.id}") do |rjs|
131
- with_tag("form[class=edit_lead]")
132
- end
133
- rendered.should include(%Q/$("lead_#{@lead.id}").visualEffect("shake"/)
119
+ rendered.should include("jQuery('#lead_#{@lead.id}').html")
120
+ rendered.should include(%Q/jQuery('#lead_#{@lead.id}').effect("shake"/)
134
121
  end
135
122
  end
136
123
 
@@ -141,17 +128,15 @@ describe "/leads/promote" do
141
128
 
142
129
  it "should redraw the [Convert Lead] form and shake it" do
143
130
  render
144
- rendered.should have_rjs("lead_#{@lead.id}") do |rjs|
145
- with_tag("form[class=edit_lead]")
146
- end
147
- rendered.should include(%Q/$("lead_#{@lead.id}").visualEffect("shake"/)
131
+ rendered.should include("jQuery('#lead_#{@lead.id}').html")
132
+ rendered.should include(%Q/jQuery('#lead_#{@lead.id}').effect("shake"/)
148
133
  end
149
134
  end
150
135
 
151
136
  it "should handle new or existing account and set up calendar field" do
152
137
  render
153
138
  rendered.should include("crm.create_or_select_account")
154
- rendered.should include('$("account_name").focus()')
139
+ rendered.should include('focus()')
155
140
  end
156
141
  end # errors
157
142
  end