require 'test_helper' module Workarea decorate Blog::WordpressImportIntegrationTest, with: :one_theme do def test_creates_all_objects if running_from_source? Rails.application.load_tasks Rake::Task['workarea:blog:import_wordpress'].invoke(wordpress_xml_path) else Rake::Task['app:workarea:blog:import_wordpress'].invoke(wordpress_xml_path) end entries = Workarea::Content::BlogEntry.all assert(entries.present?) assert_equal(4, entries.count) assert_equal(Workarea.config.wordpress_import[:blog_name], entries.first.blog.name) pages = Workarea::Content::Page.all assert(pages.present?) assert_equal(2, pages.count) assets = Workarea::Content::Asset.all assert(assets.present?) assert_equal(2, assets.count) end end end