Skip to content

Commit a860704

Browse files
committed
update tests
1 parent 4effe1e commit a860704

2 files changed

Lines changed: 9 additions & 66 deletions

File tree

spec/lib/project_importer_spec.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,14 @@
208208

209209
it 'imports the project assets' do
210210
importer.import!
211-
expect(ScratchAsset.global_assets.where(filename: ['test_image_1.png', 'test_video_1.mp4', 'test_audio_1.mp3']).count).to eq(3)
211+
expect(project.scratch_assets.where(filename: ['test_image_1.png', 'test_video_1.mp4', 'test_audio_1.mp3']).count).to eq(3)
212+
end
213+
214+
it 'attaches the imported asset file content' do
215+
importer.import!
216+
217+
scratch_asset = project.scratch_assets.find_by(filename: 'test_image_1.png')
218+
expect(scratch_asset.file.download).to eq(sb3_fixture_content('test_image_1.png'))
212219
end
213220

214221
it 'raises and rolls back the import when the scratch content cannot be parsed' do
@@ -264,7 +271,7 @@
264271

265272
importer.import!
266273

267-
expect(ScratchAsset.global_assets.where(filename: ['test_image_1.png', 'test_video_1.mp4', 'test_audio_1.mp3']).count).to eq(3)
274+
expect(project.scratch_assets.where(filename: ['test_image_1.png', 'test_video_1.mp4', 'test_audio_1.mp3']).count).to eq(3)
268275
end
269276

270277
it 'rolls back project changes when the scratch content cannot be parsed' do

spec/lib/scratch_sb3_asset_importer_spec.rb

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)