Fixed some failing export specs.
This commit is contained in:
parent
9a603eb57f
commit
fa138b28d0
@ -20,8 +20,8 @@ module Locomotive
|
|||||||
def run!
|
def run!
|
||||||
self.initialize_site_hash
|
self.initialize_site_hash
|
||||||
|
|
||||||
self.log('copying assets')
|
self.log('copying content assets')
|
||||||
self.copy_assets
|
self.copy_content_assets
|
||||||
|
|
||||||
self.log('copying theme assets')
|
self.log('copying theme assets')
|
||||||
self.copy_theme_assets
|
self.copy_theme_assets
|
||||||
@ -163,10 +163,10 @@ module Locomotive
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def copy_assets
|
def copy_content_assets
|
||||||
@site.assets.each do |asset|
|
@site.content_assets.each do |content_asset|
|
||||||
target_path = File.join(self.samples_folder, asset.source_filename)
|
target_path = File.join(self.samples_folder, content_asset.source_filename)
|
||||||
self.copy_file_from_an_uploader(asset.source, target_path)
|
self.copy_file_from_an_uploader(content_asset.source, target_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -340,4 +340,4 @@ module Locomotive
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -42,7 +42,7 @@ module Locomotive
|
|||||||
|
|
||||||
self.reset! if @options[:reset]
|
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
|
if @options[:enabled][step] != false
|
||||||
"Locomotive::Import::#{step.camelize}".constantize.process(context, @options)
|
"Locomotive::Import::#{step.camelize}".constantize.process(context, @options)
|
||||||
@worker.update_attributes :step => step if @worker
|
@worker.update_attributes :step => step if @worker
|
||||||
@ -162,7 +162,7 @@ module Locomotive
|
|||||||
|
|
||||||
def reset!
|
def reset!
|
||||||
@site.pages.destroy_all
|
@site.pages.destroy_all
|
||||||
@site.assets.destroy_all
|
@site.content_assets.destroy_all
|
||||||
@site.theme_assets.destroy_all
|
@site.theme_assets.destroy_all
|
||||||
@site.content_types.destroy_all
|
@site.content_types.destroy_all
|
||||||
end
|
end
|
||||||
@ -176,4 +176,4 @@ module Locomotive
|
|||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -6,7 +6,7 @@ describe Locomotive::Export do
|
|||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
site = FactoryGirl.build('another site')
|
site = FactoryGirl.build('another site')
|
||||||
Site.stubs(:find).returns(site)
|
Locomotive::Site.stubs(:find).returns(site)
|
||||||
project_type = build_project_type(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 #1', :description => 'Lorem ipsum', :active => true)
|
||||||
project_type.contents.build(:title => 'Project #2', :description => 'More Lorem ipsum', :active => false)
|
project_type.contents.build(:title => 'Project #2', :description => 'More Lorem ipsum', :active => false)
|
||||||
@ -120,9 +120,9 @@ describe Locomotive::Export do
|
|||||||
|
|
||||||
after(:all) do
|
after(:all) do
|
||||||
FileUtils.rm_rf(self.zip_folder) if File.exists?(self.zip_folder)
|
FileUtils.rm_rf(self.zip_folder) if File.exists?(self.zip_folder)
|
||||||
Site.destroy_all
|
Locomotive::Site.destroy_all
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user