admin_assistant 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (400) hide show
  1. data/Rakefile +5 -14
  2. data/VERSION +1 -1
  3. data/admin_assistant.gemspec +174 -388
  4. data/lib/admin_assistant/column.rb +2 -2
  5. data/lib/admin_assistant/has_many_column.rb +6 -1
  6. data/lib/admin_assistant/polymorphic_belongs_to_column.rb +5 -1
  7. data/lib/admin_assistant.rb +4 -5
  8. data/{rails_3_test → rails_3_0}/.gitignore +0 -0
  9. data/{rails_3_test → rails_3_0}/Gemfile +0 -0
  10. data/{rails_3_test → rails_3_0}/Gemfile.lock +1 -1
  11. data/{rails_3_test → rails_3_0}/README +0 -0
  12. data/{rails_3_test → rails_3_0}/Rakefile +0 -0
  13. data/{rails_2_test → rails_3_0}/app/controllers/admin/appointments2_controller.rb +0 -0
  14. data/{rails_2_test → rails_3_0}/app/controllers/admin/appointments_controller.rb +0 -0
  15. data/{rails_2_test → rails_3_0}/app/controllers/admin/blog_posts2_controller.rb +0 -0
  16. data/{rails_2_test → rails_3_0}/app/controllers/admin/blog_posts3_controller.rb +0 -0
  17. data/{rails_2_test → rails_3_0}/app/controllers/admin/blog_posts4_controller.rb +0 -0
  18. data/{rails_2_test → rails_3_0}/app/controllers/admin/blog_posts5_controller.rb +0 -0
  19. data/{rails_2_test → rails_3_0}/app/controllers/admin/blog_posts6_controller.rb +0 -0
  20. data/{rails_3_test → rails_3_0}/app/controllers/admin/blog_posts_controller.rb +0 -0
  21. data/{rails_2_test → rails_3_0}/app/controllers/admin/blog_posts_custom_new_and_edit_controller.rb +0 -0
  22. data/{rails_2_test → rails_3_0}/app/controllers/admin/blog_posts_read_only_controller.rb +0 -0
  23. data/{rails_2_test → rails_3_0}/app/controllers/admin/bookmarks_controller.rb +0 -0
  24. data/{rails_2_test → rails_3_0}/app/controllers/admin/comments2_controller.rb +0 -0
  25. data/{rails_2_test → rails_3_0}/app/controllers/admin/comments_controller.rb +0 -0
  26. data/{rails_2_test → rails_3_0}/app/controllers/admin/images2_controller.rb +0 -0
  27. data/{rails_2_test → rails_3_0}/app/controllers/admin/images_controller.rb +0 -0
  28. data/{rails_2_test → rails_3_0}/app/controllers/admin/misconfigured1_controller.rb +0 -0
  29. data/{rails_2_test → rails_3_0}/app/controllers/admin/not_migrated_yets_controller.rb +0 -0
  30. data/{rails_2_test → rails_3_0}/app/controllers/admin/product_categories2_controller.rb +0 -0
  31. data/{rails_2_test → rails_3_0}/app/controllers/admin/product_categories_controller.rb +0 -0
  32. data/{rails_2_test → rails_3_0}/app/controllers/admin/television_airings_controller.rb +0 -0
  33. data/{rails_2_test → rails_3_0}/app/controllers/admin/television_time_slots_controller.rb +0 -0
  34. data/{rails_2_test → rails_3_0}/app/controllers/admin/users2_controller.rb +0 -0
  35. data/{rails_3_test → rails_3_0}/app/controllers/admin/users_controller.rb +0 -0
  36. data/{rails_3_test → rails_3_0}/app/controllers/application_controller.rb +0 -0
  37. data/{rails_2_test → rails_3_0}/app/controllers/blog_posts_controller.rb +0 -0
  38. data/{rails_2_test → rails_3_0}/app/helpers/admin/appointments_helper.rb +0 -0
  39. data/{rails_2_test → rails_3_0}/app/helpers/admin/blog_posts2_helper.rb +0 -0
  40. data/{rails_2_test → rails_3_0}/app/helpers/admin/blog_posts3_helper.rb +0 -0
  41. data/{rails_2_test → rails_3_0}/app/helpers/admin/blog_posts4_helper.rb +0 -0
  42. data/{rails_3_test → rails_3_0}/app/helpers/admin/blog_posts6_helper.rb +0 -0
  43. data/{rails_2_test → rails_3_0}/app/helpers/admin/blog_posts_custom_new_and_edit_helper.rb +0 -0
  44. data/{rails_2_test → rails_3_0}/app/helpers/admin/blog_posts_helper.rb +0 -0
  45. data/{rails_2_test → rails_3_0}/app/helpers/admin/blog_posts_read_only_helper.rb +0 -0
  46. data/{rails_2_test → rails_3_0}/app/helpers/admin/bookmarks_helper.rb +0 -0
  47. data/{rails_2_test → rails_3_0}/app/helpers/admin/comments2_helper.rb +0 -0
  48. data/{rails_2_test → rails_3_0}/app/helpers/admin/comments_helper.rb +0 -0
  49. data/{rails_2_test → rails_3_0}/app/helpers/admin/images2_helper.rb +0 -0
  50. data/{rails_2_test → rails_3_0}/app/helpers/admin/images_helper.rb +0 -0
  51. data/{rails_2_test → rails_3_0}/app/helpers/admin/misconfigured1_helper.rb +0 -0
  52. data/{rails_2_test → rails_3_0}/app/helpers/admin/not_migrated_yets_helper.rb +0 -0
  53. data/{rails_2_test → rails_3_0}/app/helpers/admin/product_categories2_helper.rb +0 -0
  54. data/{rails_2_test → rails_3_0}/app/helpers/admin/product_categories_helper.rb +0 -0
  55. data/{rails_2_test → rails_3_0}/app/helpers/admin/television_airings_helper.rb +0 -0
  56. data/{rails_2_test → rails_3_0}/app/helpers/admin/television_time_slots_helper.rb +0 -0
  57. data/{rails_2_test → rails_3_0}/app/helpers/admin/users2_helper.rb +0 -0
  58. data/{rails_3_test → rails_3_0}/app/helpers/admin/users_helper.rb +0 -0
  59. data/{rails_3_test → rails_3_0}/app/helpers/application_helper.rb +0 -0
  60. data/{rails_2_test → rails_3_0}/app/models/appointment.rb +0 -0
  61. data/{rails_2_test → rails_3_0}/app/models/blog_post.rb +0 -0
  62. data/{rails_2_test → rails_3_0}/app/models/blog_post_tag.rb +0 -0
  63. data/{rails_2_test → rails_3_0}/app/models/bookmark.rb +0 -0
  64. data/{rails_2_test → rails_3_0}/app/models/comment.rb +0 -0
  65. data/{rails_2_test → rails_3_0}/app/models/image.rb +0 -0
  66. data/{rails_2_test → rails_3_0}/app/models/not_migrated_yet.rb +0 -0
  67. data/{rails_3_test → rails_3_0}/app/models/product.rb +0 -0
  68. data/{rails_2_test → rails_3_0}/app/models/product_category.rb +0 -0
  69. data/{rails_2_test → rails_3_0}/app/models/tag.rb +0 -0
  70. data/{rails_2_test → rails_3_0}/app/models/television_airing.rb +0 -0
  71. data/{rails_2_test → rails_3_0}/app/models/television_time_slot.rb +0 -0
  72. data/{rails_3_test → rails_3_0}/app/models/user.rb +0 -0
  73. data/{rails_2_test → rails_3_0}/app/views/admin/appointments/_subject_input.html.erb +0 -0
  74. data/{rails_2_test → rails_3_0}/app/views/admin/appointments2/_time_input.html.erb +0 -0
  75. data/{rails_2_test → rails_3_0}/app/views/admin/blog_posts2/_after_form.html.erb +0 -0
  76. data/{rails_2_test → rails_3_0}/app/views/admin/blog_posts2/_after_index.html.erb +0 -0
  77. data/{rails_2_test → rails_3_0}/app/views/admin/blog_posts2/_after_tags_input.html.erb +0 -0
  78. data/{rails_2_test → rails_3_0}/app/views/admin/blog_posts2/_before_index.html.erb +0 -0
  79. data/{rails_2_test → rails_3_0}/app/views/admin/blog_posts5/_after_index_header.html.erb +0 -0
  80. data/{rails_2_test → rails_3_0}/app/views/admin/blog_posts_read_only/_body_for_show.html.erb +0 -0
  81. data/{rails_3_test → rails_3_0}/app/views/layouts/admin.html.erb +0 -0
  82. data/{rails_3_test → rails_3_0}/app/views/layouts/application.html.erb +0 -0
  83. data/{rails_3_test → rails_3_0}/config/application.rb +0 -0
  84. data/{rails_3_test → rails_3_0}/config/boot.rb +0 -0
  85. data/{rails_3_test → rails_3_0}/config/database.yml +0 -0
  86. data/{rails_3_test → rails_3_0}/config/environment.rb +0 -0
  87. data/{rails_3_test → rails_3_0}/config/environments/development.rb +0 -1
  88. data/{rails_3_test → rails_3_0}/config/environments/production.rb +0 -0
  89. data/{rails_3_test → rails_3_0}/config/environments/test.rb +0 -0
  90. data/{rails_3_test → rails_3_0}/config/initializers/backtrace_silencers.rb +0 -0
  91. data/{rails_3_test → rails_3_0}/config/initializers/inflections.rb +0 -0
  92. data/{rails_2_test → rails_3_0}/config/initializers/mime_types.rb +0 -0
  93. data/{rails_3_test → rails_3_0}/config/initializers/secret_token.rb +0 -0
  94. data/{rails_3_test → rails_3_0}/config/initializers/session_store.rb +0 -0
  95. data/{rails_3_test → rails_3_0}/config/locales/en.yml +0 -0
  96. data/rails_3_0/config/routes.rb +8 -0
  97. data/{rails_3_test → rails_3_0}/config.ru +0 -0
  98. data/{rails_2_test → rails_3_0}/db/migrate/20090213215514_create_blog_posts.rb +0 -0
  99. data/{rails_2_test → rails_3_0}/db/migrate/20090217225542_add_body_to_blog_posts.rb +0 -0
  100. data/{rails_2_test → rails_3_0}/db/migrate/20090221220917_create_tags.rb +0 -0
  101. data/{rails_2_test → rails_3_0}/db/migrate/20090221220947_create_blog_post_tags.rb +0 -0
  102. data/{rails_2_test → rails_3_0}/db/migrate/20090222162204_add_textile_to_blog_posts.rb +0 -0
  103. data/{rails_2_test → rails_3_0}/db/migrate/20090222163231_add_published_at_to_blog_posts.rb +0 -0
  104. data/{rails_2_test → rails_3_0}/db/migrate/20090301191722_create_images.rb +0 -0
  105. data/{rails_2_test → rails_3_0}/db/migrate/20090305165345_create_accounts.rb +0 -0
  106. data/{rails_2_test → rails_3_0}/db/migrate/20090307225027_rename_accounts_to_users.rb +0 -0
  107. data/{rails_2_test → rails_3_0}/db/migrate/20090307225750_add_user_id_to_blog_posts.rb +0 -0
  108. data/{rails_2_test → rails_3_0}/db/migrate/20090309185114_change_blog_posts_textile.rb +0 -0
  109. data/{rails_2_test → rails_3_0}/db/migrate/20090309193635_create_products.rb +0 -0
  110. data/{rails_2_test → rails_3_0}/db/migrate/20090309203056_create_comments.rb +0 -0
  111. data/{rails_2_test → rails_3_0}/db/migrate/20090323005947_create_file_column_images.rb +0 -0
  112. data/{rails_2_test → rails_3_0}/db/migrate/20090326160049_add_birthday_to_users.rb +0 -0
  113. data/{rails_2_test → rails_3_0}/db/migrate/20090326223606_add_state_to_users.rb +0 -0
  114. data/{rails_2_test → rails_3_0}/db/migrate/20090503134004_add_file_column_image_to_products.rb +0 -0
  115. data/{rails_2_test → rails_3_0}/db/migrate/20090617173651_create_bookmarks.rb +0 -0
  116. data/{rails_2_test → rails_3_0}/db/migrate/20090624165355_add_tags_string_to_blog_post.rb +0 -0
  117. data/{rails_2_test → rails_3_0}/db/migrate/20090625144313_add_avatar_fields_to_user.rb +0 -0
  118. data/{rails_2_test → rails_3_0}/db/migrate/20090629202956_add_merged_into_to_blog_posts.rb +0 -0
  119. data/{rails_2_test → rails_3_0}/db/migrate/20090701171857_add_force_textile_to_users.rb +0 -0
  120. data/{rails_2_test → rails_3_0}/db/migrate/20090704163647_add_deleted_at_to_products.rb +0 -0
  121. data/{rails_2_test → rails_3_0}/db/migrate/20090704173800_add_sale_fields_to_products.rb +0 -0
  122. data/{rails_2_test → rails_3_0}/db/migrate/20090714024501_create_product_categories.rb +0 -0
  123. data/{rails_2_test → rails_3_0}/db/migrate/20090819162835_add_admin_level_to_users.rb +0 -0
  124. data/{rails_2_test → rails_3_0}/db/migrate/20091115134559_add_first_and_last_names_to_users.rb +0 -0
  125. data/{rails_2_test → rails_3_0}/db/migrate/20091221011256_add_position_to_product_categories.rb +0 -0
  126. data/{rails_2_test → rails_3_0}/db/migrate/20091222160814_create_appointments.rb +0 -0
  127. data/{rails_2_test → rails_3_0}/db/migrate/20091227224547_add_user_id_to_appointments.rb +0 -0
  128. data/{rails_2_test → rails_3_0}/db/migrate/20100214213359_create_television_time_slots.rb +0 -0
  129. data/{rails_2_test → rails_3_0}/db/migrate/20100214213451_create_television_airings.rb +0 -0
  130. data/{rails_3_test → rails_3_0}/db/migrate/20110426215702_remove_avatar_fields_from_users.rb +0 -0
  131. data/{rails_3_test → rails_3_0}/db/seeds.rb +0 -0
  132. data/{rails_3_test → rails_3_0}/doc/README_FOR_APP +0 -0
  133. data/{rails_3_test → rails_3_0}/lib/tasks/.gitkeep +0 -0
  134. data/{rails_3_test → rails_3_0}/public/404.html +0 -0
  135. data/{rails_3_test → rails_3_0}/public/422.html +0 -0
  136. data/{rails_3_test → rails_3_0}/public/500.html +0 -0
  137. data/{rails_2_test → rails_3_0}/public/favicon.ico +0 -0
  138. data/{rails_2_test → rails_3_0}/public/images/rails.png +0 -0
  139. data/{rails_3_test → rails_3_0}/public/index.html +0 -0
  140. data/{rails_2_test → rails_3_0}/public/javascripts/application.js +0 -0
  141. data/{rails_2_test → rails_3_0}/public/javascripts/jquery-1.4.4.min.js +0 -0
  142. data/{rails_3_test → rails_3_0}/public/javascripts/rails.js +0 -0
  143. data/{rails_2_test → rails_3_0}/public/robots.txt +0 -0
  144. data/{rails_3_test → rails_3_0}/public/stylesheets/.gitkeep +0 -0
  145. data/{rails_2_test → rails_3_0}/public/stylesheets/admin.css +0 -0
  146. data/{rails_2_test → rails_3_0}/public/stylesheets/scaffold.css +0 -0
  147. data/{rails_3_test → rails_3_0}/script/rails +0 -0
  148. data/{rails_2_test → rails_3_0}/test/data/ruby_throated.jpg +0 -0
  149. data/{rails_2_test → rails_3_0}/test/data/tweenbot.jpg +0 -0
  150. data/{rails_3_test → rails_3_0}/test/fixtures/placeholder.txt +0 -0
  151. data/{rails_3_test → rails_3_0}/test/integration/admin/appointments2_integration_test.rb +0 -0
  152. data/{rails_3_test → rails_3_0}/test/integration/admin/appointments_integration_test.rb +0 -0
  153. data/{rails_3_test → rails_3_0}/test/integration/admin/blog_posts2_integration_test.rb +2 -2
  154. data/{rails_3_test → rails_3_0}/test/integration/admin/blog_posts3_integration_test.rb +0 -0
  155. data/{rails_3_test → rails_3_0}/test/integration/admin/blog_posts4_integration_test.rb +0 -0
  156. data/{rails_3_test → rails_3_0}/test/integration/admin/blog_posts5_integration_test.rb +0 -0
  157. data/{rails_3_test → rails_3_0}/test/integration/admin/blog_posts6_integration_test.rb +0 -0
  158. data/{rails_3_test → rails_3_0}/test/integration/admin/blog_posts_custom_new_and_edit_integration_test.rb +0 -0
  159. data/{rails_3_test → rails_3_0}/test/integration/admin/blog_posts_integration_test.rb +8 -16
  160. data/{rails_3_test → rails_3_0}/test/integration/admin/blog_posts_read_only_integration_test.rb +0 -0
  161. data/{rails_3_test → rails_3_0}/test/integration/admin/bookmarks_integration_test.rb +0 -0
  162. data/{rails_3_test → rails_3_0}/test/integration/admin/comments2_integration_test.rb +0 -0
  163. data/{rails_3_test → rails_3_0}/test/integration/admin/comments_integration_test.rb +0 -0
  164. data/{rails_2_test → rails_3_0}/test/integration/admin/images2_integration_test.rb +0 -0
  165. data/{rails_3_test → rails_3_0}/test/integration/admin/images_integration_test.rb +0 -0
  166. data/{rails_3_test → rails_3_0}/test/integration/admin/misconfigured1_integration_test.rb +0 -0
  167. data/{rails_3_test → rails_3_0}/test/integration/admin/product_categories2_integration_test.rb +0 -0
  168. data/{rails_2_test → rails_3_0}/test/integration/admin/product_categories_integration_test.rb +0 -0
  169. data/{rails_2_test → rails_3_0}/test/integration/admin/television_airings_integration_test.rb +0 -0
  170. data/{rails_2_test → rails_3_0}/test/integration/admin/users2_integration_test.rb +0 -0
  171. data/{rails_3_test → rails_3_0}/test/integration/admin/users_integration_test.rb +0 -0
  172. data/{rails_3_test → rails_3_0}/test/integration/blog_posts_integration_test.rb +0 -0
  173. data/{rails_3_test → rails_3_0}/test/performance/browsing_test.rb +0 -0
  174. data/{rails_3_test → rails_3_0}/test/test_helper.rb +40 -0
  175. data/{rails_3_test → rails_3_0}/vendor/plugins/.gitkeep +0 -0
  176. data/rails_3_1/Gemfile +12 -0
  177. data/rails_3_1/Gemfile.lock +116 -0
  178. data/rails_3_1/README +256 -0
  179. data/{rails_2_test → rails_3_1}/Rakefile +2 -8
  180. data/rails_3_1/config.ru +4 -0
  181. metadata +176 -390
  182. data/lib/admin_assistant/date_time_range_end_point_selector.rb +0 -341
  183. data/rails_2_test/README +0 -256
  184. data/rails_2_test/app/controllers/admin/blog_posts_controller.rb +0 -8
  185. data/rails_2_test/app/controllers/admin/file_column_images2_controller.rb +0 -10
  186. data/rails_2_test/app/controllers/admin/file_column_images_controller.rb +0 -6
  187. data/rails_2_test/app/controllers/admin/products2_controller.rb +0 -15
  188. data/rails_2_test/app/controllers/admin/products_controller.rb +0 -31
  189. data/rails_2_test/app/controllers/admin/users_controller.rb +0 -63
  190. data/rails_2_test/app/controllers/application.rb +0 -16
  191. data/rails_2_test/app/controllers/application_controller.rb +0 -16
  192. data/rails_2_test/app/helpers/admin/appointments2_helper.rb +0 -2
  193. data/rails_2_test/app/helpers/admin/blog_posts6_helper.rb +0 -16
  194. data/rails_2_test/app/helpers/admin/file_column_images2_helper.rb +0 -2
  195. data/rails_2_test/app/helpers/admin/file_column_images_helper.rb +0 -2
  196. data/rails_2_test/app/helpers/admin/products2_helper.rb +0 -3
  197. data/rails_2_test/app/helpers/admin/products_helper.rb +0 -6
  198. data/rails_2_test/app/helpers/admin/users_helper.rb +0 -25
  199. data/rails_2_test/app/helpers/application_helper.rb +0 -3
  200. data/rails_2_test/app/helpers/blog_posts_helper.rb +0 -2
  201. data/rails_2_test/app/models/file_column_image.rb +0 -3
  202. data/rails_2_test/app/models/product.rb +0 -7
  203. data/rails_2_test/app/models/user.rb +0 -14
  204. data/rails_2_test/app/views/admin/products/_name_input.html.erb +0 -2
  205. data/rails_2_test/app/views/admin/products/_percent_off_input.html.erb +0 -2
  206. data/rails_2_test/app/views/admin/products/_price_input.html.erb +0 -10
  207. data/rails_2_test/app/views/blog_posts/show.html.erb +0 -13
  208. data/rails_2_test/app/views/layouts/admin.html.erb +0 -31
  209. data/rails_2_test/config/boot.rb +0 -109
  210. data/rails_2_test/config/database.yml +0 -28
  211. data/rails_2_test/config/environment.rb +0 -78
  212. data/rails_2_test/config/environments/development.rb +0 -17
  213. data/rails_2_test/config/environments/production.rb +0 -24
  214. data/rails_2_test/config/environments/test.rb +0 -24
  215. data/rails_2_test/config/initializers/inflections.rb +0 -10
  216. data/rails_2_test/config/initializers/new_rails_defaults.rb +0 -17
  217. data/rails_2_test/config/locales/en.yml +0 -5
  218. data/rails_2_test/config/routes.rb +0 -43
  219. data/rails_2_test/doc/README_FOR_APP +0 -5
  220. data/rails_2_test/lib/tasks/rspec.rake +0 -163
  221. data/rails_2_test/public/404.html +0 -30
  222. data/rails_2_test/public/422.html +0 -30
  223. data/rails_2_test/public/500.html +0 -33
  224. data/rails_2_test/public/dispatch.cgi +0 -10
  225. data/rails_2_test/public/dispatch.fcgi +0 -24
  226. data/rails_2_test/public/dispatch.rb +0 -10
  227. data/rails_2_test/public/index.html +0 -274
  228. data/rails_2_test/script/about +0 -4
  229. data/rails_2_test/script/autospec +0 -5
  230. data/rails_2_test/script/console +0 -3
  231. data/rails_2_test/script/dbconsole +0 -3
  232. data/rails_2_test/script/destroy +0 -3
  233. data/rails_2_test/script/generate +0 -3
  234. data/rails_2_test/script/performance/benchmarker +0 -3
  235. data/rails_2_test/script/performance/profiler +0 -3
  236. data/rails_2_test/script/performance/request +0 -3
  237. data/rails_2_test/script/plugin +0 -3
  238. data/rails_2_test/script/populate_tables.rb +0 -49
  239. data/rails_2_test/script/process/inspector +0 -3
  240. data/rails_2_test/script/process/reaper +0 -3
  241. data/rails_2_test/script/process/spawner +0 -3
  242. data/rails_2_test/script/runner +0 -3
  243. data/rails_2_test/script/server +0 -3
  244. data/rails_2_test/script/spec +0 -5
  245. data/rails_2_test/script/spec_server +0 -125
  246. data/rails_2_test/test/fixtures/file_column_images.yml +0 -7
  247. data/rails_2_test/test/integration/admin/appointments2_integration_test.rb +0 -79
  248. data/rails_2_test/test/integration/admin/appointments_integration_test.rb +0 -367
  249. data/rails_2_test/test/integration/admin/blog_posts2_integration_test.rb +0 -806
  250. data/rails_2_test/test/integration/admin/blog_posts3_integration_test.rb +0 -418
  251. data/rails_2_test/test/integration/admin/blog_posts4_integration_test.rb +0 -189
  252. data/rails_2_test/test/integration/admin/blog_posts5_integration_test.rb +0 -75
  253. data/rails_2_test/test/integration/admin/blog_posts6_integration_test.rb +0 -39
  254. data/rails_2_test/test/integration/admin/blog_posts_custom_new_and_edit_integration_test.rb +0 -89
  255. data/rails_2_test/test/integration/admin/blog_posts_integration_test.rb +0 -788
  256. data/rails_2_test/test/integration/admin/blog_posts_read_only_integration_test.rb +0 -69
  257. data/rails_2_test/test/integration/admin/bookmarks_integration_test.rb +0 -445
  258. data/rails_2_test/test/integration/admin/comments2_integration_test.rb +0 -52
  259. data/rails_2_test/test/integration/admin/comments_integration_test.rb +0 -50
  260. data/rails_2_test/test/integration/admin/file_column_images2_integration_test.rb +0 -19
  261. data/rails_2_test/test/integration/admin/file_column_images_integration_test.rb +0 -69
  262. data/rails_2_test/test/integration/admin/images_integration_test.rb +0 -79
  263. data/rails_2_test/test/integration/admin/misconfigured1_integration_test.rb +0 -17
  264. data/rails_2_test/test/integration/admin/product_categories2_integration_test.rb +0 -179
  265. data/rails_2_test/test/integration/admin/products2_integration_test.rb +0 -155
  266. data/rails_2_test/test/integration/admin/products_integration_test.rb +0 -210
  267. data/rails_2_test/test/integration/admin/users_integration_test.rb +0 -266
  268. data/rails_2_test/test/integration/blog_posts_integration_test.rb +0 -9
  269. data/rails_2_test/test/test_helper.rb +0 -114
  270. data/rails_2_test/vendor/plugins/file_column/CHANGELOG +0 -69
  271. data/rails_2_test/vendor/plugins/file_column/README +0 -54
  272. data/rails_2_test/vendor/plugins/file_column/Rakefile +0 -36
  273. data/rails_2_test/vendor/plugins/file_column/TODO +0 -6
  274. data/rails_2_test/vendor/plugins/file_column/init.rb +0 -13
  275. data/rails_2_test/vendor/plugins/file_column/lib/file_column.rb +0 -723
  276. data/rails_2_test/vendor/plugins/file_column/lib/file_column_helper.rb +0 -150
  277. data/rails_2_test/vendor/plugins/file_column/lib/file_compat.rb +0 -28
  278. data/rails_2_test/vendor/plugins/file_column/lib/magick_file_column.rb +0 -260
  279. data/rails_2_test/vendor/plugins/file_column/lib/rails_file_column.rb +0 -19
  280. data/rails_2_test/vendor/plugins/file_column/lib/test_case.rb +0 -124
  281. data/rails_2_test/vendor/plugins/file_column/lib/validations.rb +0 -112
  282. data/rails_2_test/vendor/plugins/file_column/test/abstract_unit.rb +0 -63
  283. data/rails_2_test/vendor/plugins/file_column/test/connection.rb +0 -17
  284. data/rails_2_test/vendor/plugins/file_column/test/file_column_helper_test.rb +0 -97
  285. data/rails_2_test/vendor/plugins/file_column/test/file_column_test.rb +0 -650
  286. data/rails_2_test/vendor/plugins/file_column/test/fixtures/entry.rb +0 -32
  287. data/rails_2_test/vendor/plugins/file_column/test/fixtures/invalid-image.jpg +0 -1
  288. data/rails_2_test/vendor/plugins/file_column/test/fixtures/kerb.jpg +0 -0
  289. data/rails_2_test/vendor/plugins/file_column/test/fixtures/mysql.sql +0 -25
  290. data/rails_2_test/vendor/plugins/file_column/test/fixtures/schema.rb +0 -10
  291. data/rails_2_test/vendor/plugins/file_column/test/fixtures/skanthak.png +0 -0
  292. data/rails_2_test/vendor/plugins/file_column/test/magick_test.rb +0 -380
  293. data/rails_2_test/vendor/plugins/file_column/test/magick_view_only_test.rb +0 -21
  294. data/rails_3_test/app/controllers/admin/appointments2_controller.rb +0 -15
  295. data/rails_3_test/app/controllers/admin/appointments_controller.rb +0 -11
  296. data/rails_3_test/app/controllers/admin/blog_posts2_controller.rb +0 -138
  297. data/rails_3_test/app/controllers/admin/blog_posts3_controller.rb +0 -76
  298. data/rails_3_test/app/controllers/admin/blog_posts4_controller.rb +0 -21
  299. data/rails_3_test/app/controllers/admin/blog_posts5_controller.rb +0 -27
  300. data/rails_3_test/app/controllers/admin/blog_posts6_controller.rb +0 -10
  301. data/rails_3_test/app/controllers/admin/blog_posts_custom_new_and_edit_controller.rb +0 -15
  302. data/rails_3_test/app/controllers/admin/blog_posts_read_only_controller.rb +0 -19
  303. data/rails_3_test/app/controllers/admin/bookmarks_controller.rb +0 -11
  304. data/rails_3_test/app/controllers/admin/comments2_controller.rb +0 -14
  305. data/rails_3_test/app/controllers/admin/comments_controller.rb +0 -12
  306. data/rails_3_test/app/controllers/admin/images2_controller.rb +0 -11
  307. data/rails_3_test/app/controllers/admin/images_controller.rb +0 -6
  308. data/rails_3_test/app/controllers/admin/misconfigured1_controller.rb +0 -7
  309. data/rails_3_test/app/controllers/admin/not_migrated_yets_controller.rb +0 -9
  310. data/rails_3_test/app/controllers/admin/product_categories2_controller.rb +0 -7
  311. data/rails_3_test/app/controllers/admin/product_categories_controller.rb +0 -5
  312. data/rails_3_test/app/controllers/admin/television_airings_controller.rb +0 -5
  313. data/rails_3_test/app/controllers/admin/television_time_slots_controller.rb +0 -5
  314. data/rails_3_test/app/controllers/admin/users2_controller.rb +0 -10
  315. data/rails_3_test/app/controllers/blog_posts_controller.rb +0 -5
  316. data/rails_3_test/app/helpers/admin/appointments_helper.rb +0 -2
  317. data/rails_3_test/app/helpers/admin/blog_posts2_helper.rb +0 -27
  318. data/rails_3_test/app/helpers/admin/blog_posts3_helper.rb +0 -2
  319. data/rails_3_test/app/helpers/admin/blog_posts4_helper.rb +0 -2
  320. data/rails_3_test/app/helpers/admin/blog_posts_custom_new_and_edit_helper.rb +0 -29
  321. data/rails_3_test/app/helpers/admin/blog_posts_helper.rb +0 -2
  322. data/rails_3_test/app/helpers/admin/blog_posts_read_only_helper.rb +0 -2
  323. data/rails_3_test/app/helpers/admin/bookmarks_helper.rb +0 -2
  324. data/rails_3_test/app/helpers/admin/comments2_helper.rb +0 -2
  325. data/rails_3_test/app/helpers/admin/comments_helper.rb +0 -2
  326. data/rails_3_test/app/helpers/admin/images2_helper.rb +0 -8
  327. data/rails_3_test/app/helpers/admin/images_helper.rb +0 -2
  328. data/rails_3_test/app/helpers/admin/misconfigured1_helper.rb +0 -2
  329. data/rails_3_test/app/helpers/admin/not_migrated_yets_helper.rb +0 -2
  330. data/rails_3_test/app/helpers/admin/product_categories2_helper.rb +0 -2
  331. data/rails_3_test/app/helpers/admin/product_categories_helper.rb +0 -2
  332. data/rails_3_test/app/helpers/admin/television_airings_helper.rb +0 -2
  333. data/rails_3_test/app/helpers/admin/television_time_slots_helper.rb +0 -2
  334. data/rails_3_test/app/helpers/admin/users2_helper.rb +0 -2
  335. data/rails_3_test/app/models/appointment.rb +0 -5
  336. data/rails_3_test/app/models/blog_post.rb +0 -14
  337. data/rails_3_test/app/models/blog_post_tag.rb +0 -6
  338. data/rails_3_test/app/models/bookmark.rb +0 -6
  339. data/rails_3_test/app/models/comment.rb +0 -4
  340. data/rails_3_test/app/models/image.rb +0 -3
  341. data/rails_3_test/app/models/not_migrated_yet.rb +0 -2
  342. data/rails_3_test/app/models/product_category.rb +0 -9
  343. data/rails_3_test/app/models/tag.rb +0 -4
  344. data/rails_3_test/app/models/television_airing.rb +0 -3
  345. data/rails_3_test/app/models/television_time_slot.rb +0 -11
  346. data/rails_3_test/app/views/admin/appointments/_subject_input.html.erb +0 -2
  347. data/rails_3_test/app/views/admin/appointments2/_time_input.html.erb +0 -31
  348. data/rails_3_test/app/views/admin/blog_posts2/_after_form.html.erb +0 -5
  349. data/rails_3_test/app/views/admin/blog_posts2/_after_index.html.erb +0 -1
  350. data/rails_3_test/app/views/admin/blog_posts2/_after_tags_input.html.erb +0 -16
  351. data/rails_3_test/app/views/admin/blog_posts2/_before_index.html.erb +0 -2
  352. data/rails_3_test/app/views/admin/blog_posts5/_after_index_header.html.erb +0 -8
  353. data/rails_3_test/app/views/admin/blog_posts_read_only/_body_for_show.html.erb +0 -1
  354. data/rails_3_test/config/initializers/mime_types.rb +0 -5
  355. data/rails_3_test/config/routes.rb +0 -63
  356. data/rails_3_test/db/migrate/20090213215514_create_blog_posts.rb +0 -12
  357. data/rails_3_test/db/migrate/20090217225542_add_body_to_blog_posts.rb +0 -9
  358. data/rails_3_test/db/migrate/20090221220917_create_tags.rb +0 -13
  359. data/rails_3_test/db/migrate/20090221220947_create_blog_post_tags.rb +0 -14
  360. data/rails_3_test/db/migrate/20090222162204_add_textile_to_blog_posts.rb +0 -9
  361. data/rails_3_test/db/migrate/20090222163231_add_published_at_to_blog_posts.rb +0 -9
  362. data/rails_3_test/db/migrate/20090301191722_create_images.rb +0 -16
  363. data/rails_3_test/db/migrate/20090305165345_create_accounts.rb +0 -14
  364. data/rails_3_test/db/migrate/20090307225027_rename_accounts_to_users.rb +0 -9
  365. data/rails_3_test/db/migrate/20090307225750_add_user_id_to_blog_posts.rb +0 -9
  366. data/rails_3_test/db/migrate/20090309185114_change_blog_posts_textile.rb +0 -9
  367. data/rails_3_test/db/migrate/20090309193635_create_products.rb +0 -14
  368. data/rails_3_test/db/migrate/20090309203056_create_comments.rb +0 -15
  369. data/rails_3_test/db/migrate/20090323005947_create_file_column_images.rb +0 -12
  370. data/rails_3_test/db/migrate/20090326160049_add_birthday_to_users.rb +0 -9
  371. data/rails_3_test/db/migrate/20090326223606_add_state_to_users.rb +0 -9
  372. data/rails_3_test/db/migrate/20090503134004_add_file_column_image_to_products.rb +0 -9
  373. data/rails_3_test/db/migrate/20090617173651_create_bookmarks.rb +0 -15
  374. data/rails_3_test/db/migrate/20090624165355_add_tags_string_to_blog_post.rb +0 -9
  375. data/rails_3_test/db/migrate/20090625144313_add_avatar_fields_to_user.rb +0 -11
  376. data/rails_3_test/db/migrate/20090629202956_add_merged_into_to_blog_posts.rb +0 -9
  377. data/rails_3_test/db/migrate/20090701171857_add_force_textile_to_users.rb +0 -9
  378. data/rails_3_test/db/migrate/20090704163647_add_deleted_at_to_products.rb +0 -9
  379. data/rails_3_test/db/migrate/20090704173800_add_sale_fields_to_products.rb +0 -13
  380. data/rails_3_test/db/migrate/20090714024501_create_product_categories.rb +0 -15
  381. data/rails_3_test/db/migrate/20090819162835_add_admin_level_to_users.rb +0 -9
  382. data/rails_3_test/db/migrate/20091115134559_add_first_and_last_names_to_users.rb +0 -11
  383. data/rails_3_test/db/migrate/20091221011256_add_position_to_product_categories.rb +0 -9
  384. data/rails_3_test/db/migrate/20091222160814_create_appointments.rb +0 -14
  385. data/rails_3_test/db/migrate/20091227224547_add_user_id_to_appointments.rb +0 -9
  386. data/rails_3_test/db/migrate/20100214213359_create_television_time_slots.rb +0 -13
  387. data/rails_3_test/db/migrate/20100214213451_create_television_airings.rb +0 -15
  388. data/rails_3_test/public/favicon.ico +0 -0
  389. data/rails_3_test/public/images/rails.png +0 -0
  390. data/rails_3_test/public/javascripts/application.js +0 -2
  391. data/rails_3_test/public/javascripts/jquery-1.4.4.min.js +0 -167
  392. data/rails_3_test/public/robots.txt +0 -5
  393. data/rails_3_test/public/stylesheets/admin.css +0 -3
  394. data/rails_3_test/public/stylesheets/scaffold.css +0 -54
  395. data/rails_3_test/test/data/ruby_throated.jpg +0 -0
  396. data/rails_3_test/test/data/tweenbot.jpg +0 -0
  397. data/rails_3_test/test/integration/admin/images2_integration_test.rb +0 -33
  398. data/rails_3_test/test/integration/admin/product_categories_integration_test.rb +0 -12
  399. data/rails_3_test/test/integration/admin/television_airings_integration_test.rb +0 -25
  400. data/rails_3_test/test/integration/admin/users2_integration_test.rb +0 -48
@@ -1,418 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + "/../../test_helper")
2
-
3
- class Admin::BlogPosts3IntegrationTest < ActionController::IntegrationTest
4
- def setup
5
- User.destroy_all
6
- @user = User.create! :username => 'soren', :password => 'password'
7
- end
8
-
9
- def test_create_with_no_title
10
- @orig_blog_post_count = BlogPost.count
11
- post "/admin/blog_posts3/create", :blog_post => {:user_id => @user.id}
12
-
13
- # should redirect to the index
14
- assert_redirected_to(:action => 'index')
15
-
16
- # should create a new blog post with the title pre-filled as (draft)
17
- assert_equal(@orig_blog_post_count + 1, BlogPost.count)
18
- blog_post = BlogPost.last
19
- assert_equal('(draft)', blog_post.title)
20
- end
21
-
22
- def test_edit
23
- @blog_post = BlogPost.create! :title => random_word, :user => @user
24
- get "/admin/blog_posts3/edit/#{@blog_post.id}"
25
-
26
- # should have a body field
27
- assert_select('textarea[name=?]', 'blog_post[body]')
28
-
29
- # should not include textile
30
- assert_no_match(/textile/, response.body)
31
- end
32
-
33
- def test_index_with_no_blog_posts
34
- BlogPost.destroy_all
35
- get "/admin/blog_posts3"
36
- assert_response :success
37
-
38
- # should use the activescaffold-themed CSS
39
- assert_select(
40
- 'link[href^=/stylesheets/admin_assistant/activescaffold.css]'
41
- )
42
-
43
- # should say 'Posts'
44
- assert_select('h2', :text => 'Posts')
45
- end
46
-
47
- def test_index_with_one_unpublished_blog_post
48
- BlogPost.destroy_all
49
- @blog_post = BlogPost.create!(
50
- :title => "unpublished blog post", :user => @user,
51
- :published_at => nil
52
- )
53
- $cache.flush
54
- get "/admin/blog_posts3"
55
-
56
- # should show the blog post
57
- assert_match(/unpublished blog post/, response.body)
58
-
59
- # should show 'No' from having called BlogPost#published?
60
- assert_select("tr[id=blog_post_#{@blog_post.id}]") do
61
- assert_select "td", :text => 'No'
62
- end
63
-
64
- # should not have a comparator for the ID search field
65
- assert_select('form[id=search_form][method=get]') do
66
- assert_select("select[name=?]", "search[id(comparator)]", false)
67
- end
68
-
69
- # should have a blank checkbox for the body search field
70
- assert_select('form[id=search_form][method=get]') do
71
- assert_select("input[type=checkbox][name=?]", "search[body(blank)]")
72
- end
73
-
74
- # should render extra action links in order
75
- assert_match(/Short title.*Blank body/m, response.body)
76
-
77
- # should have a trinary select for the has_short_title search field
78
- assert_select('form[id=search_form][method=get]') do
79
- assert_select('select[name=?]', 'search[has_short_title]') do
80
- assert_select("option[value='']", :text => '')
81
- assert_select("option[value='true']", :text => 'Yes')
82
- assert_select("option[value='false']", :text => 'No')
83
- end
84
- end
85
-
86
- # should show a search form with specific fields
87
- assert_select(
88
- 'form[id=search_form][method=get]', :text => /Title/
89
- ) do
90
- assert_select('input[name=?]', 'search[title]')
91
- assert_select('input[name=?]', 'search[body]')
92
- assert_select('select[name=?]', 'search[textile]') do
93
- assert_select("option[value='']", :text => '')
94
- assert_select("option[value='true']", :text => 'true')
95
- assert_select("option[value='false']", :text => 'false')
96
- end
97
- assert_select('label', :text => 'User')
98
- assert_select('input[name=?]', 'search[user]')
99
- end
100
-
101
- # should set the count in memcache
102
- key =
103
- "AdminAssistant::Admin::BlogPosts3Controller_count_published_at_is_null_"
104
- assert_equal(1, $cache.read(key))
105
- assert_in_delta(12.hours, $cache.expires_in(key), 5.seconds)
106
-
107
- # should not make the textile field an Ajax toggle
108
- toggle_div_id = "blog_post_#{@blog_post.id}_textile"
109
- assert_no_match(%r|new Ajax.Updater\('#{toggle_div_id}'|, response.body)
110
- end
111
-
112
- def test_index_with_a_published_blog_post
113
- $cache.flush
114
- BlogPost.destroy_all
115
- BlogPost.create!(
116
- :title => "published blog post", :user => @user,
117
- :published_at => Time.now.utc
118
- )
119
- get "/admin/blog_posts3"
120
-
121
- # should not show the blog post
122
- assert_no_match(/published blog post/, response.body)
123
- assert_match(/No posts found/, response.body)
124
- end
125
-
126
- def test_index_when_searching_by_user
127
- User.destroy_all
128
- tiffany = User.create!(:username => 'tiffany')
129
- BlogPost.create! :title => "By Tiffany", :user => tiffany
130
- BlogPost.create!(
131
- :title => "Already published", :user => tiffany,
132
- :published_at => Time.now
133
- )
134
- bill = User.create! :username => 'bill', :password => 'parsimony'
135
- BlogPost.create! :title => "By Bill", :user => bill
136
- brooklyn_steve = User.create!(
137
- :username => 'brooklyn_steve', :state => 'NY'
138
- )
139
- BlogPost.create! :title => "By Brooklyn Steve", :user => brooklyn_steve
140
- sadie = User.create!(
141
- :username => 'Sadie', :password => 'sadie', :state => 'KY'
142
- )
143
- BlogPost.create! :title => "By Sadie", :user => sadie
144
- get(
145
- "/admin/blog_posts3",
146
- :search => {
147
- :body => "", :textile => "", :id => "", :user => 'ny',
148
- :has_short_title => ''
149
- }
150
- )
151
- assert_response :success
152
-
153
- # should match the string to the username
154
- assert_match(/By Tiffany/, response.body)
155
-
156
- # should match the string to the password
157
- assert_match(/By Bill/, response.body)
158
-
159
- # should match the string to the state
160
- assert_match(/By Brooklyn Steve/, response.body)
161
-
162
- # should skip blog posts that don't match anything on the user
163
- assert_no_match(/By Sadie/, response.body)
164
-
165
- # should skip blog posts that have already been published
166
- assert_no_match(/Already published/, response.body)
167
- end
168
-
169
- def test_index_with_blog_posts_from_two_different_users
170
- aardvark_man = User.create!(:username => 'aardvark_man')
171
- BlogPost.create! :title => 'AARDVARKS!!!!!1', :user => aardvark_man
172
- ziggurat = User.create!(:username => 'zigguratz')
173
- BlogPost.create! :title => "Wanna go climbing?", :user => ziggurat
174
- get "/admin/blog_posts3"
175
- assert_response :success
176
-
177
- # should sort by username
178
- assert_match(%r|AARDVARKS!!!!!1.*Wanna go climbing|m, response.body)
179
- end
180
-
181
- def test_index_when_searching_for_a_blank_body
182
- BlogPost.destroy_all
183
- @nil_body_post = BlogPost.create!(
184
- :title => "nil", :user => @user, :body => nil
185
- )
186
- @empty_string_body_post = BlogPost.create!(
187
- :title => "empty string", :user => @user, :body => ''
188
- )
189
- @non_blank_body_post = BlogPost.create!(
190
- :title => "non-blank", :user => @user, :body => 'foo'
191
- )
192
- get(
193
- "/admin/blog_posts3",
194
- :search => {
195
- "body(blank)" => '1', :user => '', :body => '', :title => '',
196
- :textile => '', :id => '', '(all_or_any)' => 'all',
197
- :has_short_title => ''
198
- }
199
- )
200
-
201
- # should retrieve a blog post with a nil body
202
- assert_select("tr[id=?]", "blog_post_#{@nil_body_post.id}")
203
-
204
- # should retrieve a blog post with a space-only string body
205
- assert_select(
206
- "tr[id=?]", "blog_post_#{@empty_string_body_post.id}"
207
- )
208
-
209
- # should not retrieve a blog post with a non-blank body
210
- assert_select(
211
- "tr[id=?]", "blog_post_#{@non_blank_body_post.id}", false
212
- )
213
-
214
- # should have a checked blank checkbox for the body search field
215
- assert_select('form[id=search_form][method=get]') do
216
- assert_select(
217
- "input[type=checkbox][checked=checked][name=?]",
218
- "search[body(blank)]"
219
- )
220
- end
221
- end
222
-
223
- def test_index_when_searching_for_short_title_blog_posts
224
- BlogPost.destroy_all
225
- @bp1 = BlogPost.create!(
226
- :title => 'short', :body => 'foobar', :user => @user
227
- )
228
- @bp2 = BlogPost.create!(
229
- :title => "longer title", :body => 'foobar', :user => @user
230
- )
231
- get(
232
- "/admin/blog_posts3",
233
- :search => {
234
- :body => "", "body(blank)" => '0', :textile => "", :id => "",
235
- :user => '', :has_short_title => 'true'
236
- }
237
- )
238
-
239
- # should return a short-titled blog post
240
- assert_select('td', :text => 'short')
241
-
242
- # should not return a longer-title blog post
243
- assert_no_match(%r|<td[^>]*>longer title</td>|, response.body)
244
-
245
- # should pre-select 'true' in the has_short_title search field
246
- assert_select('form[id=search_form][method=get]') do
247
- assert_select('select[name=?]', 'search[has_short_title]') do
248
- assert_select("option[value='']", :text => '')
249
- assert_select("option[value='true'][selected=selected]", :text => 'Yes')
250
- assert_select("option[value='false']", :text => 'No')
251
- end
252
- end
253
- end
254
-
255
- def test_index_when_searching_for_long_titled_blog_posts
256
- BlogPost.destroy_all
257
- @bp1 = BlogPost.create!(
258
- :title => 'short', :body => 'foobar', :user => @user
259
- )
260
- @bp2 = BlogPost.create!(
261
- :title => "longer title", :body => 'foobar', :user => @user
262
- )
263
- get(
264
- "/admin/blog_posts3",
265
- :search => {
266
- :body => "", "body(blank)" => '0', :textile => "", :id => "",
267
- :user => '', :has_short_title => 'false'
268
- }
269
- )
270
-
271
- # should not return a short-titled blog post
272
- assert_no_match(%r|<td[^>]*>short</td>|, response.body)
273
-
274
- # should return a longer-title blog post
275
- assert_select('td', :text => 'longer title')
276
-
277
- # should pre-select 'false' in the has_short_title search field
278
- assert_select('form[id=search_form][method=get]') do
279
- assert_select('select[name=?]', 'search[has_short_title]') do
280
- assert_select("option[value='']", :text => '')
281
- assert_select("option[value='true']", :text => 'Yes')
282
- assert_select("option[value='false'][selected=selected]", :text => 'No')
283
- end
284
- end
285
- end
286
-
287
- def test_index_when_searching_for_blog_posts_of_any_title_length
288
- BlogPost.destroy_all
289
- @bp1 = BlogPost.create!(
290
- :title => 'short', :body => 'foobar', :user => @user
291
- )
292
- @bp2 = BlogPost.create!(
293
- :title => "longer title", :body => 'foobar', :user => @user
294
- )
295
- get(
296
- "/admin/blog_posts3",
297
- :search => {
298
- :body => 'foobar', "body(blank)" => '0', :textile => "", :id => "",
299
- :user => '', :has_short_title => ''
300
- }
301
- )
302
-
303
- # should return a short-titled blog post
304
- assert_select('td', :text => 'short')
305
-
306
- # should return a longer-title blog post
307
- assert_select('td', :text => 'longer title')
308
- end
309
-
310
- def test_index_when_searching_by_id
311
- BlogPost.destroy_all
312
- @blog_post1 = BlogPost.create! :title => random_word, :user => @user
313
- blog_post2 = BlogPost.create! :title => random_word, :user => @user
314
- BlogPost.update_all(
315
- "id = #{@blog_post1.id * 10}", "id = #{blog_post2.id}"
316
- )
317
- @blog_post2 = BlogPost.find(@blog_post1.id * 10)
318
- get(
319
- "/admin/blog_posts3",
320
- :search => {
321
- :body => '', "body(blank)" => '0', :textile => "",
322
- :id => @blog_post1.id.to_s, :user => '', :has_short_title => ''
323
- }
324
- )
325
-
326
- # should match the record with that ID
327
- assert_select("tr[id=?]", "blog_post_#{@blog_post1.id}")
328
-
329
- # should not match a record with an ID that has the ID as a substring
330
- assert_select("tr[id=?]", "blog_post_#{@blog_post2.id}", false)
331
- end
332
-
333
- def test_index_when_the_blank_body_count_has_been_cached_in_memcache_but_the_request_is_looking_for_the_default_index
334
- $cache.flush
335
- another_key =
336
- "AdminAssistant::Admin::BlogPosts3Controller_count__body_is_null_or_body______"
337
- $cache.write another_key, 1_000_000, :expires_in => 12.hours
338
- get "/admin/blog_posts3"
339
-
340
- # should not read a value from memcache
341
- assert_no_match(/1000000 posts found/, response.body)
342
-
343
- # should set the count in memcache
344
- key =
345
- "AdminAssistant::Admin::BlogPosts3Controller_count_published_at_is_null_"
346
- assert $cache.read(key)
347
- assert_in_delta(12.hours, $cache.expires_in(key), 5.seconds)
348
- end
349
-
350
- def test_index_when_the_count_has_been_cached_in_memcache
351
- BlogPost.create!(:title => "title", :user => @user)
352
- key =
353
- "AdminAssistant::Admin::BlogPosts3Controller_count_published_at_is_null_"
354
- $cache.write key, 1_000_000, :expires_in => 12.hours
355
- $cache.raise_on_write
356
- get "/admin/blog_posts3"
357
-
358
- # should read memcache and not hit the database
359
- assert_match(/1000000 posts found/, response.body)
360
- end
361
-
362
- def test_index_with_more_than_one_pages_worth_of_unpublished_blog_posts
363
- $cache.flush
364
- BlogPost.destroy_all
365
- 1.upto(26) do |i|
366
- BlogPost.create!(
367
- :title => "unpublished blog post #{i}", :user => @user,
368
- :published_at => nil
369
- )
370
- end
371
- @unpub_count = BlogPost.count "published_at is null"
372
- $cache.flush
373
- get "/admin/blog_posts3"
374
-
375
- # should cache the total number of entries, not the entries on just this page
376
- key =
377
- "AdminAssistant::Admin::BlogPosts3Controller_count_published_at_is_null_"
378
- assert_equal(@unpub_count, $cache.read(key))
379
- assert_in_delta(12.hours, $cache.expires_in(key), 5.seconds)
380
- end
381
-
382
- def test_new
383
- @request_time = Time.now.utc
384
- get "/admin/blog_posts3/new"
385
-
386
- # should not have a body field
387
- assert_select('textarea[name=?]', 'blog_post[body]', false)
388
-
389
- # should have a published_at select that starts in the year 2009
390
- name = 'blog_post[published_at(1i)]'
391
- assert_select('select[name=?]', name) do
392
- assert_select "option[value='2009']"
393
- assert_select "option[value='2010']"
394
- assert_select "option[value='2008']", false
395
- end
396
-
397
- # should have a published_at select that is set to now
398
- name = 'blog_post[published_at(3i)]'
399
- assert_select('select[name=?]', name) do
400
- assert_select "option[value=?][selected=selected]", @request_time.day
401
- end
402
-
403
- # should not show a nullify link for published_at
404
- assert_no_match(%r|<a [^>]*>Set "published at" to nil</a>|, response.body)
405
-
406
- # should say 'New post'
407
- assert_select('h2', :text => 'New post')
408
- end
409
-
410
- def test_show
411
- @blog_post = BlogPost.create! :title => "title", :user => @user
412
- get "/admin/blog_posts3/show/#{@blog_post.id}"
413
- assert_response :success
414
-
415
- # should say 'Post [ID]'
416
- assert_select('h2', :text => "Post #{@blog_post.id}")
417
- end
418
- end
@@ -1,189 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + "/../../test_helper")
2
-
3
- class Admin::BlogPosts4IntegrationTest < ActionController::IntegrationTest
4
- def setup
5
- User.destroy_all
6
- @user = User.create! :username => 'soren'
7
- end
8
-
9
- def test_index
10
- BlogPost.create!(
11
- :published_at => Time.utc(2009, 9, 1, 12, 30, 0), :user => @user,
12
- :title => 'whatever'
13
- )
14
- get "/admin/blog_posts4"
15
- assert_response :success
16
-
17
- # should show datetime stuff in the search form for published_at
18
- assert_select(
19
- 'form[id=search_form][method=get]', :text => /Title/
20
- ) do
21
- assert_select('select[name=?]', 'search[published_at(comparator)]') do
22
- assert_select("option[value=?]", ">", :text => 'greater than')
23
- assert_select("option[value=?]", "<", :text => 'less than')
24
- end
25
- nums_and_dt_fields = {
26
- 1 => :year, 2 => :month, 3 => :day, 4 => :hour, 5 => :min
27
- }
28
- nums_and_dt_fields.each do |num, dt_field|
29
- name = "search[published_at(#{num}i)]"
30
- value_for_now_option = Time.now.send(dt_field).to_s
31
- if [:hour, :min].include?(dt_field) && value_for_now_option.size == 1
32
- value_for_now_option = "0#{value_for_now_option}"
33
- end
34
- assert_select('select[name=?]', name) do
35
- assert_select "option[value='']"
36
- assert_select "option[value=?]", value_for_now_option
37
- end
38
- end
39
- assert_select(
40
- "a.clear_datetime_select[data-prefix=search_published_at]",
41
- :text => 'Clear'
42
- )
43
- end
44
-
45
- # should use strftime_format for displaying published_at
46
- assert_select('td', :text => "Sep 01, 2009 12:30:00")
47
- end
48
-
49
- def test_index_when_searching_by_published_at_with_a_greater_than_comparator
50
- @jun_blog_post = BlogPost.create!(
51
- :published_at => Time.utc(2009,6,1), :title => 'June', :user => @user
52
- )
53
- @aug_blog_post = BlogPost.create!(
54
- :published_at => Time.utc(2009,8,1), :title => 'August', :user => @user
55
- )
56
- get(
57
- "/admin/blog_posts4",
58
- :search => {
59
- :textile => '', :title => '', :user_id => '',
60
- 'published_at(comparator)' => '>',
61
- 'published_at(1i)' => '2009', 'published_at(2i)' => '7',
62
- 'published_at(3i)' => '1', 'published_at(4i)' => '1',
63
- 'published_at(5i)' => '1'
64
- }
65
- )
66
- assert_response :success
67
-
68
- # should include a blog post with a published_at time after the entered time
69
- assert_select('td', :text => 'August')
70
-
71
- # should not include a blog post with a published_at time before the entered time
72
- assert_no_match(%r|<td[^>]*>June</td>|, response.body)
73
-
74
- # should show the right fields pre-filled in the search form
75
- assert_select(
76
- 'form[id=search_form][method=get]', :text => /Title/
77
- ) do
78
- assert_select('select[name=?]', 'search[published_at(comparator)]') do
79
- assert_select(
80
- "option[value=?][selected=selected]", ">", :text => 'greater than'
81
- )
82
- assert_select("option[value=?]", "<", :text => 'less than')
83
- end
84
- assert_select('select[name=?]', 'search[published_at(1i)]') do
85
- assert_select "option[value=?][selected=selected]", "2009"
86
- end
87
- assert_select('select[name=?]', 'search[published_at(2i)]') do
88
- assert_select "option[value=?][selected=selected]", "7"
89
- end
90
- assert_select('select[name=?]', 'search[published_at(3i)]') do
91
- assert_select "option[value=?][selected=selected]", "1"
92
- end
93
- assert_select('select[name=?]', 'search[published_at(4i)]') do
94
- assert_select "option[value=?][selected=selected]", "01"
95
- end
96
- assert_select('select[name=?]', 'search[published_at(5i)]') do
97
- assert_select "option[value=?][selected=selected]", "01"
98
- end
99
- end
100
- end
101
-
102
- def test_index_when_searching_by_published_at_with_a_less_than_comparator
103
- @jun_blog_post = BlogPost.create!(
104
- :published_at => Time.utc(2009,6,1), :title => 'June', :user => @user
105
- )
106
- @aug_blog_post = BlogPost.create!(
107
- :published_at => Time.utc(2009,8,1), :title => 'August', :user => @user
108
- )
109
- get(
110
- "/admin/blog_posts4",
111
- :search => {
112
- :textile => '', :title => '', :user_id => '',
113
- 'published_at(comparator)' => '<',
114
- 'published_at(1i)' => '2009', 'published_at(2i)' => '7',
115
- 'published_at(3i)' => '1', 'published_at(4i)' => '1',
116
- 'published_at(5i)' => '1'
117
- }
118
- )
119
- assert_response :success
120
-
121
- # should not include a blog post with a published_at time after the entered time
122
- assert_no_match(%r|<td[^>]*>August</td>|, response.body)
123
-
124
- # should include a blog post with a published_at time before the entered time
125
- assert_select('td', :text => 'June')
126
-
127
- # should show the right fields pre-filled in the search form
128
- assert_select(
129
- 'form[id=search_form][method=get]', :text => /Title/
130
- ) do
131
- assert_select('select[name=?]', 'search[published_at(comparator)]') do
132
- assert_select "option[value=?]", ">", :text => 'greater than'
133
- assert_select(
134
- "option[value=?][selected=selected]", "<", :text => 'less than'
135
- )
136
- end
137
- assert_select('select[name=?]', 'search[published_at(1i)]') do
138
- assert_select "option[value=?][selected=selected]", "2009"
139
- end
140
- assert_select('select[name=?]', 'search[published_at(2i)]') do
141
- assert_select "option[value=?][selected=selected]", "7"
142
- end
143
- assert_select('select[name=?]', 'search[published_at(3i)]') do
144
- assert_select "option[value=?][selected=selected]", "1"
145
- end
146
- assert_select('select[name=?]', 'search[published_at(4i)]') do
147
- assert_select "option[value=?][selected=selected]", "01"
148
- end
149
- assert_select('select[name=?]', 'search[published_at(5i)]') do
150
- assert_select "option[value=?][selected=selected]", "01"
151
- end
152
- end
153
- end
154
-
155
- def test_index_with_26_unpublished_blog_posts
156
- BlogPost.destroy_all
157
- 1.upto(26) do |i|
158
- BlogPost.create!(
159
- :title => "--post #{i}--", :user => @user, :published_at => nil
160
- )
161
- end
162
- get "/admin/blog_posts4"
163
-
164
- # should not show link to page 2
165
- assert_select("a[href=/admin/blog_posts4?page=2]", false)
166
-
167
- # should only say 25 blog posts found
168
- assert_match(/25 blog posts found/, response.body)
169
- end
170
-
171
- def test_new
172
- get "/admin/blog_posts4/new"
173
-
174
- # should use a textarea for virtual_text
175
- assert_select("textarea[name=?]", "blog_post[virtual_text]")
176
- end
177
-
178
- def test_show
179
- @blog_post = BlogPost.create!(
180
- :published_at => Time.utc(2009, 9, 1, 12, 30, 0), :user => @user,
181
- :title => 'whatever'
182
- )
183
- get "/admin/blog_posts4/show/#{@blog_post.id}"
184
- assert_response :success
185
-
186
- # should use strftime_format for displaying published_at
187
- assert_match(/Sep 01, 2009 12:30:00/, response.body)
188
- end
189
- end
@@ -1,75 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + "/../../test_helper")
2
-
3
- class Admin::BlogPosts5IntegrationTest < ActionController::IntegrationTest
4
- def setup
5
- User.destroy_all
6
- @soren = User.create! :username => 'soren'
7
- @jean = User.create! :username => 'jean'
8
- end
9
-
10
- def test_create_with_title_alt
11
- post(
12
- "/admin/blog_posts5/create",
13
- :blog_post => {
14
- :user_id => @soren.id, :title => '', :title_alt => 'alternate field'
15
- }
16
- )
17
- assert_response :redirect
18
-
19
- # should use the value of title alt for the title
20
- bp = BlogPost.last
21
- assert_equal('alternate field', bp.title)
22
- end
23
-
24
- def test_index
25
- BlogPost.create!(
26
- :published_at => Time.utc(2009, 9, 1, 12, 30, 0), :user => @soren,
27
- :title => 'whatever'
28
- )
29
- BlogPost.create!(
30
- :published_at => Time.utc(2009, 9, 1, 12, 30, 0), :user => @soren,
31
- :title => 'just do it'
32
- )
33
- get "/admin/blog_posts5"
34
- assert_response :success
35
-
36
- # should render the filter.html.erb partial
37
- assert_select('ul.aa_filter')
38
- assert_select('ul.aa_filter li a', :text => "soren")
39
- assert_select('td', :text => "whatever")
40
- assert_select('td', :text => "just do it")
41
- end
42
-
43
- def test_index_filter
44
- BlogPost.create!(
45
- :published_at => Time.utc(2009, 9, 1, 12, 30, 0), :user => @soren,
46
- :title => 'whatever'
47
- )
48
- BlogPost.create!(
49
- :published_at => Time.utc(2009, 9, 1, 12, 30, 0), :user => @soren,
50
- :title => 'whatever'
51
- )
52
-
53
- get "/admin/blog_posts5?filter=#{@soren.id}"
54
- assert_response :success
55
-
56
- # should filter blog posts by user id
57
- assert_select('td', :text => "whatever")
58
- assert_no_match(%r|<td[^>]*>just do it</td>|, response.body)
59
- end
60
-
61
- def test_search_retains_filter
62
- user1 = User.find_or_create_by_username 'friedrich'
63
- user2 = User.find_or_create_by_username 'rene'
64
-
65
- BlogPost.create! :title => "God is dead", :user => user1
66
- blog_post2 = BlogPost.create! :title => "I think therefore I am", :user => user2
67
-
68
- visit "/admin/blog_posts5"
69
- click_link "friedrich"
70
- fill_in "search", :with => 'I think therefore I am'
71
- click_button 'Search'
72
-
73
- assert_select 'a[href=?]', "/admin/blog_posts5/edit/#{blog_post2.id}", false
74
- end
75
- end