workarea-blog 3.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +20 -0
- data/.eslintignore +2 -0
- data/.eslintrc +24 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
- data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.gitignore +16 -0
- data/.rspec +2 -0
- data/.scss-lint.yml +188 -0
- data/.tailor +180 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +1123 -0
- data/CODE_OF_CONDUCT.md +3 -0
- data/CONTRIBUTING.md +3 -0
- data/Gemfile +7 -0
- data/LICENSE +52 -0
- data/README.md +140 -0
- data/Rakefile +42 -0
- data/app/assets/images/workarea/admin/blog/content_block_types/blog_entry.svg +1 -0
- data/app/assets/images/workarea/admin/blog/icons/blog.svg +1 -0
- data/app/assets/images/workarea/admin/blog/icons/blog_entry.svg +1 -0
- data/app/assets/images/workarea/admin/blog/icons/blog_post_comment.svg +1 -0
- data/app/assets/javascripts/workarea/storefront/blog/modules/blog_comment_placeholder.js +33 -0
- data/app/assets/stylesheets/workarea/admin/blog/components/_blog_entry_card.scss +14 -0
- data/app/assets/stylesheets/workarea/storefront/blog/components/_blog_entry.scss +91 -0
- data/app/assets/stylesheets/workarea/storefront/blog/components/_blog_entry_summary.scss +74 -0
- data/app/assets/stylesheets/workarea/storefront/blog/components/_featured_entry_content_block.scss +22 -0
- data/app/controllers/workarea/admin/application_controller.decorator +5 -0
- data/app/controllers/workarea/admin/content_blog_comments_controller.rb +54 -0
- data/app/controllers/workarea/admin/content_blog_entries_controller.rb +70 -0
- data/app/controllers/workarea/admin/content_blogs_controller.rb +56 -0
- data/app/controllers/workarea/admin/create_content_blog_entries_controller.rb +69 -0
- data/app/controllers/workarea/storefront/blog_comments_controller.rb +14 -0
- data/app/controllers/workarea/storefront/blog_entries_controller.rb +48 -0
- data/app/controllers/workarea/storefront/blogs_controller.rb +19 -0
- data/app/helpers/workarea/admin/blogs_helper.rb +61 -0
- data/app/models/workarea/content/blog.rb +26 -0
- data/app/models/workarea/content/blog_comment.rb +67 -0
- data/app/models/workarea/content/blog_entry.rb +35 -0
- data/app/models/workarea/content/fields/blog_entry_id.rb +11 -0
- data/app/models/workarea/content/fields/blog_id.rb +8 -0
- data/app/models/workarea/search/admin/content_blog.rb +27 -0
- data/app/models/workarea/search/admin/content_blog_entry.rb +37 -0
- data/app/queries/workarea/metadata/content_blog.rb +6 -0
- data/app/queries/workarea/metadata/content_blog_entry.rb +6 -0
- data/app/queries/workarea/search/admin_blog_entries.rb +24 -0
- data/app/queries/workarea/search/admin_blogs.rb +20 -0
- data/app/seeds/workarea/blog_comments_seeds.rb +26 -0
- data/app/seeds/workarea/blog_entry_seeds.rb +73 -0
- data/app/seeds/workarea/blog_seeds.rb +53 -0
- data/app/services/workarea/search/queries/blog_admin.rb +20 -0
- data/app/services/workarea/search/queries/blog_entry_admin.rb +13 -0
- data/app/services/workarea/set_navigable.decorator +10 -0
- data/app/view_models/workarea/admin/blog_comments_view_model.rb +45 -0
- data/app/view_models/workarea/admin/blog_entries_view_model.rb +31 -0
- data/app/view_models/workarea/admin/blog_entry_view_model.rb +29 -0
- data/app/view_models/workarea/admin/blog_search_view_model.rb +6 -0
- data/app/view_models/workarea/admin/blog_view_model.rb +13 -0
- data/app/view_models/workarea/storefront/blog_entry_view_model.rb +43 -0
- data/app/view_models/workarea/storefront/blog_index_view_model.rb +17 -0
- data/app/view_models/workarea/storefront/blog_view_model.rb +83 -0
- data/app/view_models/workarea/storefront/content_blocks/blog_entry_content_block_view_model.rb +63 -0
- data/app/views/workarea/admin/activities/_content_blog_comment_create.html.haml +12 -0
- data/app/views/workarea/admin/activities/_content_blog_comment_destroy.html.haml +9 -0
- data/app/views/workarea/admin/activities/_content_blog_comment_update.html.haml +10 -0
- data/app/views/workarea/admin/activities/_content_blog_create.html.haml +12 -0
- data/app/views/workarea/admin/activities/_content_blog_destroy.html.haml +10 -0
- data/app/views/workarea/admin/activities/_content_blog_entry_create.html.haml +12 -0
- data/app/views/workarea/admin/activities/_content_blog_entry_destroy.html.haml +10 -0
- data/app/views/workarea/admin/activities/_content_blog_entry_update.html.haml +10 -0
- data/app/views/workarea/admin/activities/_content_blog_update.html.haml +10 -0
- data/app/views/workarea/admin/blog/_dashboard_navigation.html.haml +1 -0
- data/app/views/workarea/admin/blog/_menu.html.haml +13 -0
- data/app/views/workarea/admin/content_blocks/_blog_entry_id.html.haml +4 -0
- data/app/views/workarea/admin/content_blocks/_blog_id.html.haml +3 -0
- data/app/views/workarea/admin/content_blog_comments/_summary.html.haml +24 -0
- data/app/views/workarea/admin/content_blog_comments/edit.html.haml +60 -0
- data/app/views/workarea/admin/content_blog_comments/index.html.haml +49 -0
- data/app/views/workarea/admin/content_blog_entries/_aux_navigation.html.haml +4 -0
- data/app/views/workarea/admin/content_blog_entries/_cards.html.haml +113 -0
- data/app/views/workarea/admin/content_blog_entries/_summary.html.haml +10 -0
- data/app/views/workarea/admin/content_blog_entries/edit.html.haml +75 -0
- data/app/views/workarea/admin/content_blog_entries/index.html.haml +80 -0
- data/app/views/workarea/admin/content_blog_entries/index.json.jbuilder +5 -0
- data/app/views/workarea/admin/content_blog_entries/show.html.haml +20 -0
- data/app/views/workarea/admin/content_blog_entries/thumbnail_image.html.haml +55 -0
- data/app/views/workarea/admin/content_blogs/_aux_navigation.html.haml +2 -0
- data/app/views/workarea/admin/content_blogs/_cards.html.haml +58 -0
- data/app/views/workarea/admin/content_blogs/_summary.html.haml +6 -0
- data/app/views/workarea/admin/content_blogs/edit.html.haml +51 -0
- data/app/views/workarea/admin/content_blogs/index.html.haml +76 -0
- data/app/views/workarea/admin/content_blogs/index.json.jbuilder +4 -0
- data/app/views/workarea/admin/content_blogs/new.html.haml +33 -0
- data/app/views/workarea/admin/content_blogs/show.html.haml +19 -0
- data/app/views/workarea/admin/create_content_blog_entries/content.html.haml +28 -0
- data/app/views/workarea/admin/create_content_blog_entries/featured_products.html.haml +71 -0
- data/app/views/workarea/admin/create_content_blog_entries/publish.html.haml +51 -0
- data/app/views/workarea/admin/create_content_blog_entries/setup.html.haml +61 -0
- data/app/views/workarea/admin/create_content_blog_entries/thumbnail_image.html.haml +48 -0
- data/app/views/workarea/storefront/blog_comments/index.html.haml +31 -0
- data/app/views/workarea/storefront/blog_entries/_summary.html.haml +25 -0
- data/app/views/workarea/storefront/blog_entries/show.html.haml +85 -0
- data/app/views/workarea/storefront/blog_metadata/_publisher.html.haml +7 -0
- data/app/views/workarea/storefront/blogs/_blog_navigation.html.haml +7 -0
- data/app/views/workarea/storefront/blogs/index.html.haml +25 -0
- data/app/views/workarea/storefront/blogs/show.atom.builder +26 -0
- data/app/views/workarea/storefront/blogs/show.html.haml +31 -0
- data/app/views/workarea/storefront/content_blocks/_blog_entry.html.haml +20 -0
- data/app/workers/workarea/generate_content_metadata.decorator +15 -0
- data/bin/rails +18 -0
- data/config/initializers/appends.rb +26 -0
- data/config/initializers/content_block_types.rb +13 -0
- data/config/initializers/jump_to_navigation.rb +3 -0
- data/config/initializers/seeds.rb +5 -0
- data/config/initializers/workarea.rb +15 -0
- data/config/locales/en.yml +244 -0
- data/config/routes.rb +49 -0
- data/data/blog_thumbnails/thumbnail_1.png +0 -0
- data/data/blog_thumbnails/thumbnail_2.png +0 -0
- data/data/blog_thumbnails/thumbnail_3.png +0 -0
- data/lib/tasks/import_wordpress.rake +13 -0
- data/lib/tasks/import_wordpress_attachments.rake +18 -0
- data/lib/tasks/import_wordpress_pages.rake +21 -0
- data/lib/tasks/import_wordpress_posts.rake +25 -0
- data/lib/workarea/blog/engine.rb +8 -0
- data/lib/workarea/blog/import/wordpress/attachment.rb +40 -0
- data/lib/workarea/blog/import/wordpress/content_cleaner.rb +64 -0
- data/lib/workarea/blog/import/wordpress/entry.rb +76 -0
- data/lib/workarea/blog/import/wordpress/entry_parser.rb +64 -0
- data/lib/workarea/blog/import/wordpress/page.rb +69 -0
- data/lib/workarea/blog/import/wordpress/page_parser.rb +50 -0
- data/lib/workarea/blog/version.rb +5 -0
- data/lib/workarea/blog.rb +11 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/config/manifest.js +4 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/jobs/application_job.rb +2 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +34 -0
- data/test/dummy/bin/update +29 -0
- data/test/dummy/config/application.rb +26 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/cable.yml +9 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +59 -0
- data/test/dummy/config/environments/production.rb +86 -0
- data/test/dummy/config/environments/test.rb +43 -0
- data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/new_framework_defaults.rb +18 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/workarea.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/puma.rb +47 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/config/spring.rb +6 -0
- data/test/dummy/config.ru +5 -0
- data/test/dummy/db/seeds.rb +2 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/factories/blog.rb +33 -0
- data/test/factories/wordpress_import.rb +17 -0
- data/test/fixtures/test_wordpress.xml +493 -0
- data/test/integration/workarea/blog/admin_integration_test.rb +55 -0
- data/test/integration/workarea/blog/create_blog_entries_integration_test.rb +106 -0
- data/test/integration/workarea/blog/storefront_integration_test.rb +112 -0
- data/test/integration/workarea/blog/wordpress_import_integration_test.rb +26 -0
- data/test/lib/workarea/blog/import/wordpress/attachment_test.rb +20 -0
- data/test/lib/workarea/blog/import/wordpress/content_cleaner_test.rb +65 -0
- data/test/lib/workarea/blog/import/wordpress/entry_parser_test.rb +42 -0
- data/test/lib/workarea/blog/import/wordpress/entry_test.rb +61 -0
- data/test/lib/workarea/blog/import/wordpress/page_parser_test.rb +35 -0
- data/test/lib/workarea/blog/import/wordpress/page_test.rb +52 -0
- data/test/models/workarea/content/blog_comment_test.rb +57 -0
- data/test/models/workarea/content/blog_entry_test.rb +17 -0
- data/test/queries/workarea/metadata/content_blog_entry_test.rb +36 -0
- data/test/queries/workarea/metadata/content_blog_test.rb +36 -0
- data/test/support/workarea/blog/stub_wordpress_assets.rb +19 -0
- data/test/system/workarea/admin/blog_entries_system_test.rb +103 -0
- data/test/system/workarea/admin/blog_system_test.rb +93 -0
- data/test/system/workarea/admin/blog_taxonomy_system_test.rb +21 -0
- data/test/system/workarea/admin/blog_user_comments_system_test.rb +138 -0
- data/test/system/workarea/storefront/blog_content_block_system_test.rb +36 -0
- data/test/system/workarea/storefront/blog_system_test.rb +256 -0
- data/test/test_helper.rb +9 -0
- data/test/view_models/workarea/admin/blog_comments_view_model_test.rb +77 -0
- data/test/view_models/workarea/admin/blog_entries_view_model_test.rb +36 -0
- data/test/view_models/workarea/storefront/blog_entry_content_block_view_model_test.rb +100 -0
- data/test/view_models/workarea/storefront/blog_entry_view_model_test.rb +47 -0
- data/test/view_models/workarea/storefront/blog_view_model_test.rb +149 -0
- data/test/workers/workarea/generate_content_blog_metadata_test.rb +18 -0
- data/workarea-blog.gemspec +19 -0
- metadata +274 -0
@@ -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,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,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,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"] %>
|
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
|