Spec: assets URLs in contents text fields should be correctly mapped.
This commit is contained in:
parent
d75604d654
commit
a8b00b247b
BIN
spec/fixtures/themes/default2.zip
vendored
Normal file
BIN
spec/fixtures/themes/default2.zip
vendored
Normal file
Binary file not shown.
@ -137,4 +137,20 @@ describe Locomotive::Import::Job do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with a content referencing an asset' do
|
||||||
|
before(:all) do
|
||||||
|
@site = FactoryGirl.create(:site)
|
||||||
|
|
||||||
|
job = Locomotive::Import::Job.new(FixturedTheme.duplicate_and_open('default2.zip'), @site, { :samples => true, :reset => true })
|
||||||
|
job.perform
|
||||||
|
|
||||||
|
job.success nil
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'will fix the url inside content' do
|
||||||
|
content = @site.content_types.where(:slug => 'messages').first.contents.first
|
||||||
|
asset = @site.assets.first
|
||||||
|
content.message.should == "<img src=\"/sites/#{@site.id}/assets/#{asset.id}/#{asset.source_filename}\" />"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user