Fixed some failing export specs.

This commit is contained in:
Mario Visic 2011-11-26 16:22:48 +11:00
parent 9a603eb57f
commit fa138b28d0
3 changed files with 13 additions and 13 deletions

View File

@ -20,8 +20,8 @@ module Locomotive
def run!
self.initialize_site_hash
self.log('copying assets')
self.copy_assets
self.log('copying content assets')
self.copy_content_assets
self.log('copying theme assets')
self.copy_theme_assets
@ -163,10 +163,10 @@ module Locomotive
end
end
def copy_assets
@site.assets.each do |asset|
target_path = File.join(self.samples_folder, asset.source_filename)
self.copy_file_from_an_uploader(asset.source, target_path)
def copy_content_assets
@site.content_assets.each do |content_asset|
target_path = File.join(self.samples_folder, content_asset.source_filename)
self.copy_file_from_an_uploader(content_asset.source, target_path)
end
end

View File

@ -42,7 +42,7 @@ module Locomotive
self.reset! if @options[:reset]
%w(site content_types assets snippets pages).each do |step|
%w(site content_types content_assets snippets pages).each do |step|
if @options[:enabled][step] != false
"Locomotive::Import::#{step.camelize}".constantize.process(context, @options)
@worker.update_attributes :step => step if @worker
@ -162,7 +162,7 @@ module Locomotive
def reset!
@site.pages.destroy_all
@site.assets.destroy_all
@site.content_assets.destroy_all
@site.theme_assets.destroy_all
@site.content_types.destroy_all
end

View File

@ -6,7 +6,7 @@ describe Locomotive::Export do
before(:each) do
site = FactoryGirl.build('another site')
Site.stubs(:find).returns(site)
Locomotive::Site.stubs(:find).returns(site)
project_type = build_project_type(site)
project_type.contents.build(:title => 'Project #1', :description => 'Lorem ipsum', :active => true)
project_type.contents.build(:title => 'Project #2', :description => 'More Lorem ipsum', :active => false)
@ -120,7 +120,7 @@ describe Locomotive::Export do
after(:all) do
FileUtils.rm_rf(self.zip_folder) if File.exists?(self.zip_folder)
Site.destroy_all
Locomotive::Site.destroy_all
end
end