workarea-blog 3.4.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +20 -0
  3. data/.eslintignore +2 -0
  4. data/.eslintrc +24 -0
  5. data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  6. data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
  7. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  8. data/.gitignore +16 -0
  9. data/.rspec +2 -0
  10. data/.scss-lint.yml +188 -0
  11. data/.tailor +180 -0
  12. data/.yardopts +1 -0
  13. data/CHANGELOG.md +1123 -0
  14. data/CODE_OF_CONDUCT.md +3 -0
  15. data/CONTRIBUTING.md +3 -0
  16. data/Gemfile +7 -0
  17. data/LICENSE +52 -0
  18. data/README.md +140 -0
  19. data/Rakefile +42 -0
  20. data/app/assets/images/workarea/admin/blog/content_block_types/blog_entry.svg +1 -0
  21. data/app/assets/images/workarea/admin/blog/icons/blog.svg +1 -0
  22. data/app/assets/images/workarea/admin/blog/icons/blog_entry.svg +1 -0
  23. data/app/assets/images/workarea/admin/blog/icons/blog_post_comment.svg +1 -0
  24. data/app/assets/javascripts/workarea/storefront/blog/modules/blog_comment_placeholder.js +33 -0
  25. data/app/assets/stylesheets/workarea/admin/blog/components/_blog_entry_card.scss +14 -0
  26. data/app/assets/stylesheets/workarea/storefront/blog/components/_blog_entry.scss +91 -0
  27. data/app/assets/stylesheets/workarea/storefront/blog/components/_blog_entry_summary.scss +74 -0
  28. data/app/assets/stylesheets/workarea/storefront/blog/components/_featured_entry_content_block.scss +22 -0
  29. data/app/controllers/workarea/admin/application_controller.decorator +5 -0
  30. data/app/controllers/workarea/admin/content_blog_comments_controller.rb +54 -0
  31. data/app/controllers/workarea/admin/content_blog_entries_controller.rb +70 -0
  32. data/app/controllers/workarea/admin/content_blogs_controller.rb +56 -0
  33. data/app/controllers/workarea/admin/create_content_blog_entries_controller.rb +69 -0
  34. data/app/controllers/workarea/storefront/blog_comments_controller.rb +14 -0
  35. data/app/controllers/workarea/storefront/blog_entries_controller.rb +48 -0
  36. data/app/controllers/workarea/storefront/blogs_controller.rb +19 -0
  37. data/app/helpers/workarea/admin/blogs_helper.rb +61 -0
  38. data/app/models/workarea/content/blog.rb +26 -0
  39. data/app/models/workarea/content/blog_comment.rb +67 -0
  40. data/app/models/workarea/content/blog_entry.rb +35 -0
  41. data/app/models/workarea/content/fields/blog_entry_id.rb +11 -0
  42. data/app/models/workarea/content/fields/blog_id.rb +8 -0
  43. data/app/models/workarea/search/admin/content_blog.rb +27 -0
  44. data/app/models/workarea/search/admin/content_blog_entry.rb +37 -0
  45. data/app/queries/workarea/metadata/content_blog.rb +6 -0
  46. data/app/queries/workarea/metadata/content_blog_entry.rb +6 -0
  47. data/app/queries/workarea/search/admin_blog_entries.rb +24 -0
  48. data/app/queries/workarea/search/admin_blogs.rb +20 -0
  49. data/app/seeds/workarea/blog_comments_seeds.rb +26 -0
  50. data/app/seeds/workarea/blog_entry_seeds.rb +73 -0
  51. data/app/seeds/workarea/blog_seeds.rb +53 -0
  52. data/app/services/workarea/search/queries/blog_admin.rb +20 -0
  53. data/app/services/workarea/search/queries/blog_entry_admin.rb +13 -0
  54. data/app/services/workarea/set_navigable.decorator +10 -0
  55. data/app/view_models/workarea/admin/blog_comments_view_model.rb +45 -0
  56. data/app/view_models/workarea/admin/blog_entries_view_model.rb +31 -0
  57. data/app/view_models/workarea/admin/blog_entry_view_model.rb +29 -0
  58. data/app/view_models/workarea/admin/blog_search_view_model.rb +6 -0
  59. data/app/view_models/workarea/admin/blog_view_model.rb +13 -0
  60. data/app/view_models/workarea/storefront/blog_entry_view_model.rb +43 -0
  61. data/app/view_models/workarea/storefront/blog_index_view_model.rb +17 -0
  62. data/app/view_models/workarea/storefront/blog_view_model.rb +83 -0
  63. data/app/view_models/workarea/storefront/content_blocks/blog_entry_content_block_view_model.rb +63 -0
  64. data/app/views/workarea/admin/activities/_content_blog_comment_create.html.haml +12 -0
  65. data/app/views/workarea/admin/activities/_content_blog_comment_destroy.html.haml +9 -0
  66. data/app/views/workarea/admin/activities/_content_blog_comment_update.html.haml +10 -0
  67. data/app/views/workarea/admin/activities/_content_blog_create.html.haml +12 -0
  68. data/app/views/workarea/admin/activities/_content_blog_destroy.html.haml +10 -0
  69. data/app/views/workarea/admin/activities/_content_blog_entry_create.html.haml +12 -0
  70. data/app/views/workarea/admin/activities/_content_blog_entry_destroy.html.haml +10 -0
  71. data/app/views/workarea/admin/activities/_content_blog_entry_update.html.haml +10 -0
  72. data/app/views/workarea/admin/activities/_content_blog_update.html.haml +10 -0
  73. data/app/views/workarea/admin/blog/_dashboard_navigation.html.haml +1 -0
  74. data/app/views/workarea/admin/blog/_menu.html.haml +13 -0
  75. data/app/views/workarea/admin/content_blocks/_blog_entry_id.html.haml +4 -0
  76. data/app/views/workarea/admin/content_blocks/_blog_id.html.haml +3 -0
  77. data/app/views/workarea/admin/content_blog_comments/_summary.html.haml +24 -0
  78. data/app/views/workarea/admin/content_blog_comments/edit.html.haml +60 -0
  79. data/app/views/workarea/admin/content_blog_comments/index.html.haml +49 -0
  80. data/app/views/workarea/admin/content_blog_entries/_aux_navigation.html.haml +4 -0
  81. data/app/views/workarea/admin/content_blog_entries/_cards.html.haml +113 -0
  82. data/app/views/workarea/admin/content_blog_entries/_summary.html.haml +10 -0
  83. data/app/views/workarea/admin/content_blog_entries/edit.html.haml +75 -0
  84. data/app/views/workarea/admin/content_blog_entries/index.html.haml +80 -0
  85. data/app/views/workarea/admin/content_blog_entries/index.json.jbuilder +5 -0
  86. data/app/views/workarea/admin/content_blog_entries/show.html.haml +20 -0
  87. data/app/views/workarea/admin/content_blog_entries/thumbnail_image.html.haml +55 -0
  88. data/app/views/workarea/admin/content_blogs/_aux_navigation.html.haml +2 -0
  89. data/app/views/workarea/admin/content_blogs/_cards.html.haml +58 -0
  90. data/app/views/workarea/admin/content_blogs/_summary.html.haml +6 -0
  91. data/app/views/workarea/admin/content_blogs/edit.html.haml +51 -0
  92. data/app/views/workarea/admin/content_blogs/index.html.haml +76 -0
  93. data/app/views/workarea/admin/content_blogs/index.json.jbuilder +4 -0
  94. data/app/views/workarea/admin/content_blogs/new.html.haml +33 -0
  95. data/app/views/workarea/admin/content_blogs/show.html.haml +19 -0
  96. data/app/views/workarea/admin/create_content_blog_entries/content.html.haml +28 -0
  97. data/app/views/workarea/admin/create_content_blog_entries/featured_products.html.haml +71 -0
  98. data/app/views/workarea/admin/create_content_blog_entries/publish.html.haml +51 -0
  99. data/app/views/workarea/admin/create_content_blog_entries/setup.html.haml +61 -0
  100. data/app/views/workarea/admin/create_content_blog_entries/thumbnail_image.html.haml +48 -0
  101. data/app/views/workarea/storefront/blog_comments/index.html.haml +31 -0
  102. data/app/views/workarea/storefront/blog_entries/_summary.html.haml +25 -0
  103. data/app/views/workarea/storefront/blog_entries/show.html.haml +85 -0
  104. data/app/views/workarea/storefront/blog_metadata/_publisher.html.haml +7 -0
  105. data/app/views/workarea/storefront/blogs/_blog_navigation.html.haml +7 -0
  106. data/app/views/workarea/storefront/blogs/index.html.haml +25 -0
  107. data/app/views/workarea/storefront/blogs/show.atom.builder +26 -0
  108. data/app/views/workarea/storefront/blogs/show.html.haml +31 -0
  109. data/app/views/workarea/storefront/content_blocks/_blog_entry.html.haml +20 -0
  110. data/app/workers/workarea/generate_content_metadata.decorator +15 -0
  111. data/bin/rails +18 -0
  112. data/config/initializers/appends.rb +26 -0
  113. data/config/initializers/content_block_types.rb +13 -0
  114. data/config/initializers/jump_to_navigation.rb +3 -0
  115. data/config/initializers/seeds.rb +5 -0
  116. data/config/initializers/workarea.rb +15 -0
  117. data/config/locales/en.yml +244 -0
  118. data/config/routes.rb +49 -0
  119. data/data/blog_thumbnails/thumbnail_1.png +0 -0
  120. data/data/blog_thumbnails/thumbnail_2.png +0 -0
  121. data/data/blog_thumbnails/thumbnail_3.png +0 -0
  122. data/lib/tasks/import_wordpress.rake +13 -0
  123. data/lib/tasks/import_wordpress_attachments.rake +18 -0
  124. data/lib/tasks/import_wordpress_pages.rake +21 -0
  125. data/lib/tasks/import_wordpress_posts.rake +25 -0
  126. data/lib/workarea/blog/engine.rb +8 -0
  127. data/lib/workarea/blog/import/wordpress/attachment.rb +40 -0
  128. data/lib/workarea/blog/import/wordpress/content_cleaner.rb +64 -0
  129. data/lib/workarea/blog/import/wordpress/entry.rb +76 -0
  130. data/lib/workarea/blog/import/wordpress/entry_parser.rb +64 -0
  131. data/lib/workarea/blog/import/wordpress/page.rb +69 -0
  132. data/lib/workarea/blog/import/wordpress/page_parser.rb +50 -0
  133. data/lib/workarea/blog/version.rb +5 -0
  134. data/lib/workarea/blog.rb +11 -0
  135. data/test/dummy/Rakefile +6 -0
  136. data/test/dummy/app/assets/config/manifest.js +4 -0
  137. data/test/dummy/app/assets/images/.keep +0 -0
  138. data/test/dummy/app/assets/javascripts/application.js +13 -0
  139. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  140. data/test/dummy/app/controllers/application_controller.rb +3 -0
  141. data/test/dummy/app/controllers/concerns/.keep +0 -0
  142. data/test/dummy/app/helpers/application_helper.rb +2 -0
  143. data/test/dummy/app/jobs/application_job.rb +2 -0
  144. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  145. data/test/dummy/app/models/concerns/.keep +0 -0
  146. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  147. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  148. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  149. data/test/dummy/bin/bundle +3 -0
  150. data/test/dummy/bin/rails +4 -0
  151. data/test/dummy/bin/rake +4 -0
  152. data/test/dummy/bin/setup +34 -0
  153. data/test/dummy/bin/update +29 -0
  154. data/test/dummy/config/application.rb +26 -0
  155. data/test/dummy/config/boot.rb +5 -0
  156. data/test/dummy/config/cable.yml +9 -0
  157. data/test/dummy/config/environment.rb +5 -0
  158. data/test/dummy/config/environments/development.rb +59 -0
  159. data/test/dummy/config/environments/production.rb +86 -0
  160. data/test/dummy/config/environments/test.rb +43 -0
  161. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  162. data/test/dummy/config/initializers/assets.rb +11 -0
  163. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  164. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  165. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  166. data/test/dummy/config/initializers/inflections.rb +16 -0
  167. data/test/dummy/config/initializers/mime_types.rb +4 -0
  168. data/test/dummy/config/initializers/new_framework_defaults.rb +18 -0
  169. data/test/dummy/config/initializers/session_store.rb +3 -0
  170. data/test/dummy/config/initializers/workarea.rb +3 -0
  171. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  172. data/test/dummy/config/locales/en.yml +23 -0
  173. data/test/dummy/config/puma.rb +47 -0
  174. data/test/dummy/config/routes.rb +5 -0
  175. data/test/dummy/config/secrets.yml +22 -0
  176. data/test/dummy/config/spring.rb +6 -0
  177. data/test/dummy/config.ru +5 -0
  178. data/test/dummy/db/seeds.rb +2 -0
  179. data/test/dummy/lib/assets/.keep +0 -0
  180. data/test/dummy/log/.keep +0 -0
  181. data/test/factories/blog.rb +33 -0
  182. data/test/factories/wordpress_import.rb +17 -0
  183. data/test/fixtures/test_wordpress.xml +493 -0
  184. data/test/integration/workarea/blog/admin_integration_test.rb +55 -0
  185. data/test/integration/workarea/blog/create_blog_entries_integration_test.rb +106 -0
  186. data/test/integration/workarea/blog/storefront_integration_test.rb +112 -0
  187. data/test/integration/workarea/blog/wordpress_import_integration_test.rb +26 -0
  188. data/test/lib/workarea/blog/import/wordpress/attachment_test.rb +20 -0
  189. data/test/lib/workarea/blog/import/wordpress/content_cleaner_test.rb +65 -0
  190. data/test/lib/workarea/blog/import/wordpress/entry_parser_test.rb +42 -0
  191. data/test/lib/workarea/blog/import/wordpress/entry_test.rb +61 -0
  192. data/test/lib/workarea/blog/import/wordpress/page_parser_test.rb +35 -0
  193. data/test/lib/workarea/blog/import/wordpress/page_test.rb +52 -0
  194. data/test/models/workarea/content/blog_comment_test.rb +57 -0
  195. data/test/models/workarea/content/blog_entry_test.rb +17 -0
  196. data/test/queries/workarea/metadata/content_blog_entry_test.rb +36 -0
  197. data/test/queries/workarea/metadata/content_blog_test.rb +36 -0
  198. data/test/support/workarea/blog/stub_wordpress_assets.rb +19 -0
  199. data/test/system/workarea/admin/blog_entries_system_test.rb +103 -0
  200. data/test/system/workarea/admin/blog_system_test.rb +93 -0
  201. data/test/system/workarea/admin/blog_taxonomy_system_test.rb +21 -0
  202. data/test/system/workarea/admin/blog_user_comments_system_test.rb +138 -0
  203. data/test/system/workarea/storefront/blog_content_block_system_test.rb +36 -0
  204. data/test/system/workarea/storefront/blog_system_test.rb +256 -0
  205. data/test/test_helper.rb +9 -0
  206. data/test/view_models/workarea/admin/blog_comments_view_model_test.rb +77 -0
  207. data/test/view_models/workarea/admin/blog_entries_view_model_test.rb +36 -0
  208. data/test/view_models/workarea/storefront/blog_entry_content_block_view_model_test.rb +100 -0
  209. data/test/view_models/workarea/storefront/blog_entry_view_model_test.rb +47 -0
  210. data/test/view_models/workarea/storefront/blog_view_model_test.rb +149 -0
  211. data/test/workers/workarea/generate_content_blog_metadata_test.rb +18 -0
  212. data/workarea-blog.gemspec +19 -0
  213. metadata +274 -0
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Specify a serializer for the signed and encrypted cookie jars.
4
+ # Valid options are :json, :marshal, and :hybrid.
5
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -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]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
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|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,18 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains migration options to ease your Rails 5.0 upgrade.
4
+ #
5
+ # Read the Guide for Upgrading Ruby on Rails for more info on each option.
6
+
7
+ # Enable per-form CSRF tokens. Previous versions had false.
8
+ Rails.application.config.action_controller.per_form_csrf_tokens = true
9
+
10
+ # Enable origin-checking CSRF mitigation. Previous versions had false.
11
+ Rails.application.config.action_controller.forgery_protection_origin_check = true
12
+
13
+ # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
14
+ # Previous versions had false.
15
+ ActiveSupport.to_time_preserves_timezone = true
16
+
17
+ # Configure SSL options to enable HSTS with subdomains. Previous versions had false.
18
+ Rails.application.config.ssl_options = { hsts: { subdomains: true } }
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,3 @@
1
+ Workarea.configure do |config|
2
+ config.site_name = 'Workarea Blog'
3
+ end
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
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
@@ -0,0 +1,23 @@
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.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,47 @@
1
+ # Puma can serve each request in a thread from an internal thread pool.
2
+ # The `threads` method setting takes two numbers a minimum and maximum.
3
+ # Any libraries that use thread pools should be configured to match
4
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
+ # and maximum, this matches the default thread size of Active Record.
6
+ #
7
+ threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }.to_i
8
+ threads threads_count, threads_count
9
+
10
+ # Specifies the `port` that Puma will listen on to receive requests, default is 3000.
11
+ #
12
+ port ENV.fetch('PORT') { 3000 }
13
+
14
+ # Specifies the `environment` that Puma will run in.
15
+ #
16
+ environment ENV.fetch('RAILS_ENV') { 'development' }
17
+
18
+ # Specifies the number of `workers` to boot in clustered mode.
19
+ # Workers are forked webserver processes. If using threads and workers together
20
+ # the concurrency of the application would be max `threads` * `workers`.
21
+ # Workers do not work on JRuby or Windows (both of which do not support
22
+ # processes).
23
+ #
24
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
25
+
26
+ # Use the `preload_app!` method when specifying a `workers` number.
27
+ # This directive tells Puma to first boot the application and load code
28
+ # before forking the application. This takes advantage of Copy On Write
29
+ # process behavior so workers use less memory. If you use this option
30
+ # you need to make sure to reconnect any threads in the `on_worker_boot`
31
+ # block.
32
+ #
33
+ # preload_app!
34
+
35
+ # The code in the `on_worker_boot` will be called if you are using
36
+ # clustered mode by specifying a number of `workers`. After each worker
37
+ # process is booted this block will be run, if you are using `preload_app!`
38
+ # option you will want to use this block to reconnect to any threads
39
+ # or connections that may have been created at application boot, Ruby
40
+ # cannot share connections between processes.
41
+ #
42
+ # on_worker_boot do
43
+ # ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
44
+ # end
45
+
46
+ # Allow puma to be restarted by `rails restart` command.
47
+ plugin :tmp_restart
@@ -0,0 +1,5 @@
1
+ Rails.application.routes.draw do
2
+ mount Workarea::Core::Engine => '/'
3
+ mount Workarea::Admin::Engine => '/admin', as: 'admin'
4
+ mount Workarea::Storefront::Engine => '/', as: 'storefront'
5
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rails secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: e3136ca2a4ab2bb5ea181b14ff500ae40db8718fb990d590bfed3774247d430c805c45686322f93e8a746d034fa1fba9ef00a9ce7a35aee9339675ccb0426121
15
+
16
+ test:
17
+ secret_key_base: 8183e0351525142fce68cf619e94c68caa017c9b90c03183d288ee4a32283d77838eb94bc252e5159eabf3e20a77f8df9466b5056e14b59631dfa592b67e9bbd
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,6 @@
1
+ %w[
2
+ .ruby-version
3
+ .rbenv-vars
4
+ tmp/restart.txt
5
+ tmp/caching-dev.txt
6
+ ].each { |path| Spring.watch(path) }
@@ -0,0 +1,5 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require_relative 'config/environment'
4
+
5
+ run Rails.application
@@ -0,0 +1,2 @@
1
+ require 'workarea/seeds'
2
+ Workarea::Seeds.run
File without changes
File without changes
@@ -0,0 +1,33 @@
1
+ module Workarea
2
+ module Factories
3
+ module Blog
4
+ Factories.add(self)
5
+
6
+ def create_blog(overrides = {})
7
+ attributes = { name: 'Test Blog', entries: [] }.merge(overrides)
8
+
9
+ Workarea::Content::Blog.new(attributes.except(:entries)).tap do |blog|
10
+ blog.save!
11
+
12
+ attributes[:entries].each { |entry| create_blog_entry(entry.merge(blog: blog)) }
13
+ end
14
+ end
15
+
16
+ def create_blog_entry(overrides = {})
17
+ attrs = { name: 'Test Entry', author: 'Eric Pigeon', comments: [] }.merge(overrides)
18
+
19
+ Workarea::Content::BlogEntry.new(attrs.except(:comments)).tap do |blog_entry|
20
+ blog_entry.save!
21
+
22
+ attrs[:comments].each { |comment| create_blog_comment(comment.merge(entry: blog_entry)) }
23
+ end
24
+ end
25
+
26
+ def create_blog_comment(overrides = {})
27
+ attrs = { body: 'test comment' }.merge(overrides)
28
+
29
+ Workarea::Content::BlogComment.create!(attrs)
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,17 @@
1
+ module Workarea
2
+ module Blog
3
+ module Factoris
4
+ module WordpressImport
5
+ Factories.add(self)
6
+
7
+ def wordpress_xml_path
8
+ "#{Workarea::Blog.root}/test/fixtures/test_wordpress.xml"
9
+ end
10
+
11
+ def wordpress_xml
12
+ File.open(wordpress_xml_path)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end