enju_seed 0.1.1.pre12 → 0.2.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (293) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/app/controllers/my_accounts_controller.rb +93 -0
  4. data/app/controllers/profiles_controller.rb +219 -0
  5. data/app/controllers/roles_controller.rb +61 -0
  6. data/app/models/concerns/master_model.rb +38 -0
  7. data/app/models/identity.rb +9 -0
  8. data/app/models/profile.rb +101 -0
  9. data/app/models/role.rb +50 -0
  10. data/app/models/user_has_role.rb +19 -0
  11. data/app/policies/application_policy.rb +53 -0
  12. data/app/policies/profile_policy.rb +55 -0
  13. data/app/policies/role_policy.rb +21 -0
  14. data/app/views/my_accounts/_edit_credential.html.erb +99 -0
  15. data/app/views/my_accounts/_form.html.erb +24 -0
  16. data/app/views/my_accounts/_show.html.erb +1 -0
  17. data/app/views/my_accounts/edit.html.erb +32 -0
  18. data/app/views/my_accounts/show.html+phone.erb +1 -0
  19. data/app/views/my_accounts/show.html.erb +49 -0
  20. data/app/views/profiles/_edit_credential.html.erb +88 -0
  21. data/app/views/profiles/_edit_profile.html.erb +42 -0
  22. data/app/views/profiles/_form.html.erb +15 -0
  23. data/app/views/profiles/_show.html.erb +1 -0
  24. data/app/views/profiles/edit.html.erb +33 -0
  25. data/app/views/profiles/index.html.erb +70 -0
  26. data/app/views/profiles/new.html.erb +88 -0
  27. data/app/views/profiles/show.html+phone.erb +1 -0
  28. data/app/views/profiles/show.html.erb +71 -0
  29. data/app/views/roles/_form.html.erb +19 -0
  30. data/app/views/roles/edit.html.erb +13 -0
  31. data/app/views/roles/index.html.erb +32 -0
  32. data/app/views/roles/new.html.erb +12 -0
  33. data/app/views/roles/show.html.erb +46 -0
  34. data/config/routes.rb +5 -0
  35. data/db/migrate/041_create_roles.rb +13 -0
  36. data/db/migrate/20100606065209_create_user_has_roles.rb +12 -0
  37. data/db/migrate/20130221154434_add_additional_attributes_to_user.rb +16 -0
  38. data/db/migrate/20140122054321_create_profiles.rb +20 -0
  39. data/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +11 -0
  40. data/db/migrate/20140811031145_add_expired_at_to_profile.rb +5 -0
  41. data/db/migrate/20141003181336_add_full_name_transcription_to_profile.rb +5 -0
  42. data/db/migrate/20141003182825_add_date_of_birth_to_profile.rb +5 -0
  43. data/db/migrate/20150421023923_create_identities.rb +15 -0
  44. data/db/migrate/20151126005552_add_provider_to_identity.rb +5 -0
  45. data/lib/enju_seed/engine.rb +8 -5
  46. data/lib/enju_seed/version.rb +1 -1
  47. data/spec/controllers/my_accounts_controller_spec.rb +229 -0
  48. data/spec/controllers/profiles_controller_spec.rb +594 -0
  49. data/spec/controllers/roles_controller_spec.rb +136 -0
  50. data/spec/dummy/README.rdoc +15 -248
  51. data/spec/dummy/Rakefile +1 -2
  52. data/spec/dummy/app/assets/javascripts/application.js +4 -6
  53. data/spec/dummy/app/assets/stylesheets/application.css +6 -4
  54. data/spec/dummy/app/controllers/application_controller.rb +9 -1
  55. data/spec/dummy/app/models/user.rb +9 -0
  56. data/spec/dummy/app/views/layouts/application.html.erb +2 -2
  57. data/spec/dummy/bin/bundle +3 -0
  58. data/spec/dummy/bin/rails +4 -0
  59. data/spec/dummy/bin/rake +4 -0
  60. data/spec/dummy/bin/setup +29 -0
  61. data/spec/dummy/config.ru +2 -2
  62. data/spec/dummy/config/application.rb +4 -35
  63. data/spec/dummy/config/boot.rb +4 -9
  64. data/spec/dummy/config/database.yml +8 -8
  65. data/spec/dummy/config/environment.rb +3 -3
  66. data/spec/dummy/config/environments/development.rb +22 -18
  67. data/spec/dummy/config/environments/production.rb +46 -34
  68. data/spec/dummy/config/environments/test.rb +19 -14
  69. data/spec/dummy/config/initializers/assets.rb +11 -0
  70. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  71. data/spec/dummy/config/initializers/devise.rb +274 -0
  72. data/spec/dummy/config/initializers/enju_leaf.rb +2 -0
  73. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  74. data/spec/dummy/config/initializers/inflections.rb +6 -5
  75. data/spec/dummy/config/initializers/mime_types.rb +0 -1
  76. data/spec/dummy/config/initializers/secret_token.rb +7 -2
  77. data/spec/dummy/config/initializers/session_store.rb +1 -6
  78. data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
  79. data/spec/dummy/config/locales/en.yml +20 -2
  80. data/spec/dummy/config/routes.rb +24 -25
  81. data/spec/dummy/config/secrets.yml +22 -0
  82. data/spec/dummy/db/migrate/001_create_agents.rb +50 -0
  83. data/spec/dummy/db/migrate/002_devise_create_users.rb +46 -0
  84. data/spec/dummy/db/migrate/005_create_manifestations.rb +43 -0
  85. data/spec/dummy/db/migrate/006_create_items.rb +21 -0
  86. data/spec/dummy/db/migrate/012_create_owns.rb +12 -0
  87. data/spec/dummy/db/migrate/015_create_creates.rb +12 -0
  88. data/spec/dummy/db/migrate/032_create_checkins.rb +17 -0
  89. data/spec/dummy/db/migrate/033_create_checkouts.rb +25 -0
  90. data/spec/dummy/db/migrate/035_create_reserves.rb +26 -0
  91. data/spec/dummy/db/migrate/047_create_produces.rb +12 -0
  92. data/spec/dummy/db/migrate/059_create_libraries.rb +28 -0
  93. data/spec/dummy/db/migrate/069_create_shelves.rb +15 -0
  94. data/spec/dummy/db/migrate/073_create_carrier_types.rb +11 -0
  95. data/spec/dummy/db/migrate/077_create_user_groups.rb +12 -0
  96. data/spec/dummy/db/migrate/080_create_library_groups.rb +17 -0
  97. data/spec/dummy/db/migrate/112_create_frequencies.rb +12 -0
  98. data/spec/dummy/db/migrate/117_create_form_of_works.rb +12 -0
  99. data/spec/dummy/db/migrate/120_create_baskets.rb +12 -0
  100. data/spec/dummy/db/migrate/121_create_checked_items.rb +17 -0
  101. data/spec/dummy/db/migrate/124_create_bookstores.rb +17 -0
  102. data/spec/dummy/db/migrate/125_create_donates.rb +12 -0
  103. data/spec/dummy/db/migrate/127_create_use_restrictions.rb +16 -0
  104. data/spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb +16 -0
  105. data/spec/dummy/db/migrate/130_create_request_status_types.rb +12 -0
  106. data/spec/dummy/db/migrate/131_create_request_types.rb +12 -0
  107. data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +16 -0
  108. data/spec/dummy/db/migrate/133_create_agent_merges.rb +15 -0
  109. data/spec/dummy/db/migrate/134_create_agent_merge_lists.rb +13 -0
  110. data/spec/dummy/db/migrate/149_create_message_templates.rb +18 -0
  111. data/spec/dummy/db/migrate/154_create_messages.rb +23 -0
  112. data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +18 -0
  113. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +13 -0
  114. data/spec/dummy/db/migrate/20080905191442_create_agent_types.rb +12 -0
  115. data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +17 -0
  116. data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +14 -0
  117. data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +17 -0
  118. data/spec/dummy/db/migrate/20081025083323_create_countries.rb +28 -0
  119. data/spec/dummy/db/migrate/20081025083905_create_languages.rb +23 -0
  120. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +15 -0
  121. data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +20 -0
  122. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +20 -0
  123. data/spec/dummy/db/migrate/20081030023412_create_checkout_types.rb +17 -0
  124. data/spec/dummy/db/migrate/20081030023518_create_user_group_has_checkout_types.rb +25 -0
  125. data/spec/dummy/db/migrate/20081030023615_create_carrier_type_has_checkout_types.rb +18 -0
  126. data/spec/dummy/db/migrate/20081212075554_create_checkout_stat_has_manifestations.rb +17 -0
  127. data/spec/dummy/db/migrate/20081212080038_create_manifestation_checkout_stats.rb +15 -0
  128. data/spec/dummy/db/migrate/20081215094302_create_user_checkout_stats.rb +15 -0
  129. data/spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb +17 -0
  130. data/spec/dummy/db/migrate/20081216190517_create_reserve_stat_has_manifestations.rb +17 -0
  131. data/spec/dummy/db/migrate/20081216190724_create_manifestation_reserve_stats.rb +15 -0
  132. data/spec/dummy/db/migrate/20081220023628_create_user_reserve_stats.rb +15 -0
  133. data/spec/dummy/db/migrate/20081220034117_create_reserve_stat_has_users.rb +17 -0
  134. data/spec/dummy/db/migrate/20090321130448_add_completed_at_to_user_checkout_stat.rb +23 -0
  135. data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +15 -0
  136. data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +15 -0
  137. data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +12 -0
  138. data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +12 -0
  139. data/spec/dummy/db/migrate/20090812151902_create_agent_relationship_types.rb +12 -0
  140. data/spec/dummy/db/migrate/20090831220301_create_lending_policies.rb +21 -0
  141. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +27 -0
  142. data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +12 -0
  143. data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +13 -0
  144. data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +14 -0
  145. data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +9 -0
  146. data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +13 -0
  147. data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +9 -0
  148. data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +10 -0
  149. data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +13 -0
  150. data/spec/dummy/db/migrate/20100606073747_create_agent_relationships.rb +13 -0
  151. data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +12 -0
  152. data/spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb +11 -0
  153. data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +15 -0
  154. data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +11 -0
  155. data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +9 -0
  156. data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +9 -0
  157. data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +9 -0
  158. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +11 -0
  159. data/spec/dummy/db/migrate/20110301134521_add_expire_date_to_reserve.rb +9 -0
  160. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +11 -0
  161. data/spec/dummy/db/migrate/20110328130826_add_current_checkout_count_to_user_group_has_checkout_type.rb +9 -0
  162. data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +9 -0
  163. data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +9 -0
  164. data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +11 -0
  165. data/spec/dummy/db/migrate/20110621093332_remove_expire_date_from_reserve.rb +9 -0
  166. data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +9 -0
  167. data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +12 -0
  168. data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +13 -0
  169. data/spec/dummy/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +11 -0
  170. data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +13 -0
  171. data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +10 -0
  172. data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +9 -0
  173. data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +12 -0
  174. data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +12 -0
  175. data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +12 -0
  176. data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +7 -0
  177. data/spec/dummy/db/migrate/20111129044509_add_pickup_location_to_reserve.rb +6 -0
  178. data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +5 -0
  179. data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +6 -0
  180. data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +6 -0
  181. data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +12 -0
  182. data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +6 -0
  183. data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +6 -0
  184. data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +14 -0
  185. data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +5 -0
  186. data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +5 -0
  187. data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +5 -0
  188. data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +5 -0
  189. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +5 -0
  190. data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +5 -0
  191. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +5 -0
  192. data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +5 -0
  193. data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +5 -0
  194. data/spec/dummy/db/migrate/20120424103932_add_librarian_id_to_checked_item.rb +5 -0
  195. data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +5 -0
  196. data/spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +6 -0
  197. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +5 -0
  198. data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +5 -0
  199. data/spec/dummy/db/migrate/20130303124821_add_retained_at_to_reserve.rb +5 -0
  200. data/spec/dummy/db/migrate/20130304015019_add_postponed_at_to_reserve.rb +5 -0
  201. data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +6 -0
  202. data/spec/dummy/db/migrate/20130416054135_add_circulation_status_id_to_item.rb +8 -0
  203. data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +5 -0
  204. data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +7 -0
  205. data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +5 -0
  206. data/spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +6 -0
  207. data/spec/dummy/db/migrate/20130506175303_create_identifier_types.rb +12 -0
  208. data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +15 -0
  209. data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +5 -0
  210. data/spec/dummy/db/migrate/20130519065638_add_lock_version_to_reserve.rb +5 -0
  211. data/spec/dummy/db/migrate/20130519065837_add_lock_version_to_checkin.rb +5 -0
  212. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +18 -0
  213. data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +11 -0
  214. data/spec/dummy/db/migrate/20140518050147_create_reserve_transitions.rb +18 -0
  215. data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +18 -0
  216. data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +18 -0
  217. data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +18 -0
  218. data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +18 -0
  219. data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +18 -0
  220. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +18 -0
  221. data/spec/dummy/db/migrate/20140528045518_create_user_checkout_stat_transitions.rb +18 -0
  222. data/spec/dummy/db/migrate/20140528045539_create_user_reserve_stat_transitions.rb +18 -0
  223. data/spec/dummy/db/migrate/20140528045600_create_manifestation_checkout_stat_transitions.rb +18 -0
  224. data/spec/dummy/db/migrate/20140528045617_create_manifestation_reserve_stat_transitions.rb +18 -0
  225. data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +11 -0
  226. data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +18 -0
  227. data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +5 -0
  228. data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +5 -0
  229. data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +5 -0
  230. data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +11 -0
  231. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +18 -0
  232. data/spec/dummy/db/migrate/20140720140916_add_binding_item_identifier_to_item.rb +8 -0
  233. data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +5 -0
  234. data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +5 -0
  235. data/spec/dummy/db/migrate/20140721151416_add_default_shelf_id_to_resource_import_file.rb +5 -0
  236. data/spec/dummy/db/migrate/20140802082007_add_manifestation_id_to_item.rb +6 -0
  237. data/spec/dummy/db/migrate/20140810061942_add_user_id_to_user_checkout_stat.rb +12 -0
  238. data/spec/dummy/db/migrate/20140810091231_add_checkout_icalendar_token_to_profile.rb +6 -0
  239. data/spec/dummy/db/migrate/20140810091417_add_save_checkout_history_to_profile.rb +5 -0
  240. data/spec/dummy/db/migrate/20140813182425_add_publication_place_to_manifestation.rb +5 -0
  241. data/spec/dummy/db/migrate/20140821151023_create_colors.rb +14 -0
  242. data/spec/dummy/db/migrate/20140822114527_add_error_message_to_resource_import_result.rb +5 -0
  243. data/spec/dummy/db/migrate/20140823083524_add_extent_to_manifestation.rb +5 -0
  244. data/spec/dummy/db/migrate/20140823094847_add_dimensions_to_manifestation.rb +5 -0
  245. data/spec/dummy/db/migrate/20140823095740_rename_manifestation_periodical_to_serial.rb +9 -0
  246. data/spec/dummy/db/migrate/20141014065831_add_shelf_id_to_checkout.rb +6 -0
  247. data/spec/dummy/db/migrate/20141020120523_add_library_id_to_checkout.rb +6 -0
  248. data/spec/dummy/db/migrate/20150106001709_create_demands.rb +14 -0
  249. data/spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
  250. data/spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb +5 -0
  251. data/spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +5 -0
  252. data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +13 -0
  253. data/spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb +6 -0
  254. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +13 -0
  255. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +9 -0
  256. data/spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +5 -0
  257. data/spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +9 -0
  258. data/spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +9 -0
  259. data/spec/dummy/db/migrate/20160703184619_add_most_recent_to_reserve_transitions.rb +9 -0
  260. data/spec/dummy/db/migrate/20160703184650_add_most_recent_to_manifestation_checkout_stat_transitions.rb +9 -0
  261. data/spec/dummy/db/migrate/20160703184723_add_most_recent_to_manifestation_reserve_stat_transitions.rb +9 -0
  262. data/spec/dummy/db/migrate/20160703184747_add_most_recent_to_user_checkout_stat_transitions.rb +9 -0
  263. data/spec/dummy/db/migrate/20160703184805_add_most_recent_to_user_reserve_stat_transitions.rb +9 -0
  264. data/spec/dummy/db/migrate/20160703185015_add_most_recent_to_message_transitions.rb +9 -0
  265. data/spec/dummy/db/migrate/20160703190209_add_foreign_key_on_manifestation_id_to_reserve.rb +5 -0
  266. data/spec/dummy/db/schema.rb +1392 -0
  267. data/spec/dummy/public/404.html +54 -13
  268. data/spec/dummy/public/422.html +54 -13
  269. data/spec/dummy/public/500.html +53 -12
  270. data/spec/factories/profile.rb +17 -0
  271. data/spec/factories/user.rb +43 -0
  272. data/spec/factories/user_group.rb +5 -0
  273. data/spec/fixtures/libraries.yml +101 -0
  274. data/spec/fixtures/library_groups.yml +39 -0
  275. data/spec/fixtures/message_requests.yml +26 -0
  276. data/spec/fixtures/message_templates.yml +98 -0
  277. data/spec/fixtures/messages.yml +56 -0
  278. data/spec/fixtures/profiles.yml +103 -0
  279. data/spec/fixtures/roles.yml +39 -0
  280. data/spec/fixtures/user_groups.yml +40 -0
  281. data/spec/fixtures/user_has_roles.yml +40 -0
  282. data/spec/fixtures/users.yml +51 -0
  283. data/spec/models/profile_spec.rb +98 -0
  284. data/spec/models/role_spec.rb +40 -0
  285. data/spec/rails_helper.rb +71 -0
  286. data/spec/requests/profiles_spec.rb +9 -0
  287. data/spec/routing/profiles_routing_spec.rb +35 -0
  288. data/spec/routing/users_spec.rb +14 -0
  289. data/spec/spec_helper.rb +96 -29
  290. data/spec/support/controller_macros.rb +46 -0
  291. data/spec/support/devise.rb +4 -0
  292. metadata +673 -46
  293. data/spec/dummy/script/rails +0 -6
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,274 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth.
2
+ # Many of these configuration options can be set straight in your model.
3
+ Devise.setup do |config|
4
+ # The secret key used by Devise. Devise uses this key to generate
5
+ # random tokens. Changing this key will render invalid all existing
6
+ # confirmation, reset password and unlock tokens in the database.
7
+ # Devise will use the `secret_key_base` as its `secret_key`
8
+ # by default. You can change it below and use your own secret key.
9
+ # config.secret_key = '07ef1159591b20c1e8633c4011da9fa9543079bac559f4f0af1a1dbf2a70b233ea4ce50d8ded7585e09044bd77de9d7d233d2e3e427a01d430715eb2e25ad6cb'
10
+
11
+ # ==> Mailer Configuration
12
+ # Configure the e-mail address which will be shown in Devise::Mailer,
13
+ # note that it will be overwritten if you use your own mailer class
14
+ # with default "from" parameter.
15
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
16
+
17
+ # Configure the class responsible to send e-mails.
18
+ # config.mailer = 'Devise::Mailer'
19
+
20
+ # Configure the parent class responsible to send e-mails.
21
+ # config.parent_mailer = 'ActionMailer::Base'
22
+
23
+ # ==> ORM configuration
24
+ # Load and configure the ORM. Supports :active_record (default) and
25
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
26
+ # available as additional gems.
27
+ require 'devise/orm/active_record'
28
+
29
+ # ==> Configuration for any authentication mechanism
30
+ # Configure which keys are used when authenticating a user. The default is
31
+ # just :email. You can configure it to use [:username, :subdomain], so for
32
+ # authenticating a user, both parameters are required. Remember that those
33
+ # parameters are used only when authenticating and not when retrieving from
34
+ # session. If you need permissions, you should implement that in a before filter.
35
+ # You can also supply a hash where the value is a boolean determining whether
36
+ # or not authentication should be aborted when the value is not present.
37
+ # config.authentication_keys = [:email]
38
+
39
+ # Configure parameters from the request object used for authentication. Each entry
40
+ # given should be a request method and it will automatically be passed to the
41
+ # find_for_authentication method and considered in your model lookup. For instance,
42
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
43
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
44
+ # config.request_keys = []
45
+
46
+ # Configure which authentication keys should be case-insensitive.
47
+ # These keys will be downcased upon creating or modifying a user and when used
48
+ # to authenticate or find a user. Default is :email.
49
+ config.case_insensitive_keys = [:email]
50
+
51
+ # Configure which authentication keys should have whitespace stripped.
52
+ # These keys will have whitespace before and after removed upon creating or
53
+ # modifying a user and when used to authenticate or find a user. Default is :email.
54
+ config.strip_whitespace_keys = [:email]
55
+
56
+ # Tell if authentication through request.params is enabled. True by default.
57
+ # It can be set to an array that will enable params authentication only for the
58
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
59
+ # enable it only for database (email + password) authentication.
60
+ # config.params_authenticatable = true
61
+
62
+ # Tell if authentication through HTTP Auth is enabled. False by default.
63
+ # It can be set to an array that will enable http authentication only for the
64
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
65
+ # enable it only for database authentication. The supported strategies are:
66
+ # :database = Support basic authentication with authentication key + password
67
+ # config.http_authenticatable = false
68
+
69
+ # If 401 status code should be returned for AJAX requests. True by default.
70
+ # config.http_authenticatable_on_xhr = true
71
+
72
+ # The realm used in Http Basic Authentication. 'Application' by default.
73
+ # config.http_authentication_realm = 'Application'
74
+
75
+ # It will change confirmation, password recovery and other workflows
76
+ # to behave the same regardless if the e-mail provided was right or wrong.
77
+ # Does not affect registerable.
78
+ # config.paranoid = true
79
+
80
+ # By default Devise will store the user in session. You can skip storage for
81
+ # particular strategies by setting this option.
82
+ # Notice that if you are skipping storage for all authentication paths, you
83
+ # may want to disable generating routes to Devise's sessions controller by
84
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
85
+ config.skip_session_storage = [:http_auth]
86
+
87
+ # By default, Devise cleans up the CSRF token on authentication to
88
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
89
+ # requests for sign in and sign up, you need to get a new CSRF token
90
+ # from the server. You can disable this option at your own risk.
91
+ # config.clean_up_csrf_token_on_authentication = true
92
+
93
+ # When false, Devise will not attempt to reload routes on eager load.
94
+ # This can reduce the time taken to boot the app but if your application
95
+ # requires the Devise mappings to be loaded during boot time the application
96
+ # won't boot properly.
97
+ # config.reload_routes = true
98
+
99
+ # ==> Configuration for :database_authenticatable
100
+ # For bcrypt, this is the cost for hashing the password and defaults to 11. If
101
+ # using other algorithms, it sets how many times you want the password to be hashed.
102
+ #
103
+ # Limiting the stretches to just one in testing will increase the performance of
104
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
105
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
106
+ # algorithm), the cost increases exponentially with the number of stretches (e.g.
107
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
108
+ config.stretches = Rails.env.test? ? 1 : 11
109
+
110
+ # Set up a pepper to generate the hashed password.
111
+ # config.pepper = '5ec319991b8fa828402bd73e91b4aebd0e2d941f3890553c3972e9ec44a2950f5cf90ac1bd8622d4f167668e4ec32ac2501efcfd09e4f70f253022666f3b624b'
112
+
113
+ # Send a notification email when the user's password is changed
114
+ # config.send_password_change_notification = false
115
+
116
+ # ==> Configuration for :confirmable
117
+ # A period that the user is allowed to access the website even without
118
+ # confirming their account. For instance, if set to 2.days, the user will be
119
+ # able to access the website for two days without confirming their account,
120
+ # access will be blocked just in the third day. Default is 0.days, meaning
121
+ # the user cannot access the website without confirming their account.
122
+ # config.allow_unconfirmed_access_for = 2.days
123
+
124
+ # A period that the user is allowed to confirm their account before their
125
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
126
+ # their account within 3 days after the mail was sent, but on the fourth day
127
+ # their account can't be confirmed with the token any more.
128
+ # Default is nil, meaning there is no restriction on how long a user can take
129
+ # before confirming their account.
130
+ # config.confirm_within = 3.days
131
+
132
+ # If true, requires any email changes to be confirmed (exactly the same way as
133
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
134
+ # db field (see migrations). Until confirmed, new email is stored in
135
+ # unconfirmed_email column, and copied to email column on successful confirmation.
136
+ config.reconfirmable = true
137
+
138
+ # Defines which key will be used when confirming an account
139
+ # config.confirmation_keys = [:email]
140
+
141
+ # ==> Configuration for :rememberable
142
+ # The time the user will be remembered without asking for credentials again.
143
+ # config.remember_for = 2.weeks
144
+
145
+ # Invalidates all the remember me tokens when the user signs out.
146
+ config.expire_all_remember_me_on_sign_out = true
147
+
148
+ # If true, extends the user's remember period when remembered via cookie.
149
+ # config.extend_remember_period = false
150
+
151
+ # Options to be passed to the created cookie. For instance, you can set
152
+ # secure: true in order to force SSL only cookies.
153
+ # config.rememberable_options = {}
154
+
155
+ # ==> Configuration for :validatable
156
+ # Range for password length.
157
+ config.password_length = 6..128
158
+
159
+ # Email regex used to validate email formats. It simply asserts that
160
+ # one (and only one) @ exists in the given string. This is mainly
161
+ # to give user feedback and not to assert the e-mail validity.
162
+ config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
163
+
164
+ # ==> Configuration for :timeoutable
165
+ # The time you want to timeout the user session without activity. After this
166
+ # time the user will be asked for credentials again. Default is 30 minutes.
167
+ # config.timeout_in = 30.minutes
168
+
169
+ # ==> Configuration for :lockable
170
+ # Defines which strategy will be used to lock an account.
171
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
172
+ # :none = No lock strategy. You should handle locking by yourself.
173
+ # config.lock_strategy = :failed_attempts
174
+
175
+ # Defines which key will be used when locking and unlocking an account
176
+ # config.unlock_keys = [:email]
177
+
178
+ # Defines which strategy will be used to unlock an account.
179
+ # :email = Sends an unlock link to the user email
180
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
181
+ # :both = Enables both strategies
182
+ # :none = No unlock strategy. You should handle unlocking by yourself.
183
+ # config.unlock_strategy = :both
184
+
185
+ # Number of authentication tries before locking an account if lock_strategy
186
+ # is failed attempts.
187
+ # config.maximum_attempts = 20
188
+
189
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
190
+ # config.unlock_in = 1.hour
191
+
192
+ # Warn on the last attempt before the account is locked.
193
+ # config.last_attempt_warning = true
194
+
195
+ # ==> Configuration for :recoverable
196
+ #
197
+ # Defines which key will be used when recovering the password for an account
198
+ # config.reset_password_keys = [:email]
199
+
200
+ # Time interval you can reset your password with a reset password key.
201
+ # Don't put a too small interval or your users won't have the time to
202
+ # change their passwords.
203
+ config.reset_password_within = 6.hours
204
+
205
+ # When set to false, does not sign a user in automatically after their password is
206
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
207
+ # config.sign_in_after_reset_password = true
208
+
209
+ # ==> Configuration for :encryptable
210
+ # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
211
+ # You can use :sha1, :sha512 or algorithms from others authentication tools as
212
+ # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
213
+ # for default behavior) and :restful_authentication_sha1 (then you should set
214
+ # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
215
+ #
216
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
217
+ # config.encryptor = :sha512
218
+
219
+ # ==> Scopes configuration
220
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
221
+ # "users/sessions/new". It's turned off by default because it's slower if you
222
+ # are using only default views.
223
+ # config.scoped_views = false
224
+
225
+ # Configure the default scope given to Warden. By default it's the first
226
+ # devise role declared in your routes (usually :user).
227
+ # config.default_scope = :user
228
+
229
+ # Set this configuration to false if you want /users/sign_out to sign out
230
+ # only the current scope. By default, Devise signs out all scopes.
231
+ # config.sign_out_all_scopes = true
232
+
233
+ # ==> Navigation configuration
234
+ # Lists the formats that should be treated as navigational. Formats like
235
+ # :html, should redirect to the sign in page when the user does not have
236
+ # access, but formats like :xml or :json, should return 401.
237
+ #
238
+ # If you have any extra navigational formats, like :iphone or :mobile, you
239
+ # should add them to the navigational formats lists.
240
+ #
241
+ # The "*/*" below is required to match Internet Explorer requests.
242
+ # config.navigational_formats = ['*/*', :html]
243
+
244
+ # The default HTTP method used to sign out a resource. Default is :delete.
245
+ config.sign_out_via = :delete
246
+
247
+ # ==> OmniAuth
248
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
249
+ # up on your models and hooks.
250
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
251
+
252
+ # ==> Warden configuration
253
+ # If you want to use other strategies, that are not supported by Devise, or
254
+ # change the failure app, you can configure them inside the config.warden block.
255
+ #
256
+ # config.warden do |manager|
257
+ # manager.intercept_401 = false
258
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
259
+ # end
260
+
261
+ # ==> Mountable engine configurations
262
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
263
+ # is mountable, there are some extra configurations to be taken into account.
264
+ # The following options are available, assuming the engine is mounted as:
265
+ #
266
+ # mount MyEngine, at: '/my_engine'
267
+ #
268
+ # The router that invoked `devise_for`, in the example above, would be:
269
+ # config.router_name = :my_engine
270
+ #
271
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
272
+ # so you need to do it manually. For the users scope, it would be:
273
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
274
+ end
@@ -0,0 +1,2 @@
1
+ Profile.include(EnjuCirculation::EnjuProfile)
2
+ UserGroup.include(EnjuCirculation::EnjuUserGroup)
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -1,15 +1,16 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
6
7
  # inflect.plural /^(ox)$/i, '\1en'
7
8
  # inflect.singular /^(ox)en/i, '\1'
8
9
  # inflect.irregular 'person', 'people'
9
10
  # inflect.uncountable %w( fish sheep )
10
11
  # end
11
- #
12
+
12
13
  # These inflection rules are supported but not enabled by default:
13
- # ActiveSupport::Inflector.inflections do |inflect|
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
14
15
  # inflect.acronym 'RESTful'
15
16
  # end
@@ -2,4 +2,3 @@
2
2
 
3
3
  # Add new mime types for use in respond_to blocks:
4
4
  # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -1,7 +1,12 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- # Your secret key for verifying the integrity of signed cookies.
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
4
  # If you change this key, all old signed cookies will become invalid!
5
+
5
6
  # Make sure the secret is at least 30 characters and all random,
6
7
  # no regular words or you'll be exposed to dictionary attacks.
7
- Dummy::Application.config.secret_token = 'a4bb59dcfc0e55e925e40e1d846e088e61e79021cf4cb12f2eb169d9f84b78e8925f28b25d7448fbbd854f183de0d65a74fb595e08519db5db06c7bac3e95d10'
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure your secret_key_base is kept private
11
+ # if you're sharing your code publicly.
12
+ Dummy::Application.config.secret_key_base = '95044173812b1a6e65b497db65cca6a9f75c0fcc65a2ad7a21fb32db8009af5104b08754beb9be56e808892fcf779579bf7f71107f5eafd9c0698015bcc96ed3'
@@ -1,8 +1,3 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
-
5
- # Use the database for sessions instead of the cookie-based default,
6
- # which shouldn't be used to store highly confidential information
7
- # (create the session table with "rails generate session_migration")
8
- # Dummy::Application.config.session_store :active_record_store
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -1,14 +1,14 @@
1
1
  # Be sure to restart your server when you modify this file.
2
- #
2
+
3
3
  # This file contains settings for ActionController::ParamsWrapper which
4
4
  # is enabled by default.
5
5
 
6
6
  # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
7
  ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json]
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
9
  end
10
10
 
11
- # Disable root element in JSON by default.
12
- ActiveSupport.on_load(:active_record) do
13
- self.include_root_in_json = false
14
- end
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -1,5 +1,23 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
3
21
 
4
22
  en:
5
23
  hello: "Hello world"
@@ -1,19 +1,21 @@
1
- Dummy::Application.routes.draw do
2
- # The priority is based upon order of creation:
3
- # first created -> highest priority.
1
+ Rails.application.routes.draw do
2
+ devise_for :users
3
+ # The priority is based upon order of creation: first created -> highest priority.
4
+ # See how all your routes lay out with "rake routes".
4
5
 
5
- # Sample of regular route:
6
- # match 'products/:id' => 'catalog#view'
7
- # Keep in mind you can assign values other than :controller and :action
6
+ # You can have the root of your site routed with "root"
7
+ # root 'welcome#index'
8
+
9
+ # Example of regular route:
10
+ # get 'products/:id' => 'catalog#view'
8
11
 
9
- # Sample of named route:
10
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
- # This route can be invoked with purchase_url(:id => product.id)
12
+ # Example of named route that can be invoked with purchase_url(id: product.id)
13
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
12
14
 
13
- # Sample resource route (maps HTTP verbs to controller actions automatically):
15
+ # Example resource route (maps HTTP verbs to controller actions automatically):
14
16
  # resources :products
15
17
 
16
- # Sample resource route with options:
18
+ # Example resource route with options:
17
19
  # resources :products do
18
20
  # member do
19
21
  # get 'short'
@@ -25,34 +27,31 @@ Dummy::Application.routes.draw do
25
27
  # end
26
28
  # end
27
29
 
28
- # Sample resource route with sub-resources:
30
+ # Example resource route with sub-resources:
29
31
  # resources :products do
30
32
  # resources :comments, :sales
31
33
  # resource :seller
32
34
  # end
33
35
 
34
- # Sample resource route with more complex sub-resources
36
+ # Example resource route with more complex sub-resources:
35
37
  # resources :products do
36
38
  # resources :comments
37
39
  # resources :sales do
38
- # get 'recent', :on => :collection
40
+ # get 'recent', on: :collection
39
41
  # end
40
42
  # end
41
43
 
42
- # Sample resource route within a namespace:
44
+ # Example resource route with concerns:
45
+ # concern :toggleable do
46
+ # post 'toggle'
47
+ # end
48
+ # resources :posts, concerns: :toggleable
49
+ # resources :photos, concerns: :toggleable
50
+
51
+ # Example resource route within a namespace:
43
52
  # namespace :admin do
44
53
  # # Directs /admin/products/* to Admin::ProductsController
45
54
  # # (app/controllers/admin/products_controller.rb)
46
55
  # resources :products
47
56
  # end
48
-
49
- # You can have the root of your site routed with "root"
50
- # just remember to delete public/index.html.
51
- # root :to => 'welcome#index'
52
-
53
- # See how all your routes lay out with "rake routes"
54
-
55
- # This is a legacy wild controller route that's not recommended for RESTful applications.
56
- # Note: This route will make all actions in every controller accessible via GET requests.
57
- # match ':controller(/:action(/:id))(.:format)'
58
57
  end