Skip to content

Commit

Permalink
Add a file to the transcode fixture
Browse files Browse the repository at this point in the history
I was seeing a test failure in CI

   No route matches [GET] "/rails/active_storage/disk.../track.mp3

I'm hoping that explicitly generating the file rather than relying on
TranscodeJob might fix it.
  • Loading branch information
chrislo committed Sep 10, 2023
1 parent b04410f commit 670b86d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions test/factories/transcode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@
factory :transcode do
track
format { 0 }

after(:build) do |transcode|
transcode.file.attach(
io: Rails.root.join('test/fixtures/files/track.mp3').open,
filename: 'track.mp3',
content_type: 'audio/mpeg'
)
end
end
end
Binary file added test/fixtures/files/track.mp3
Binary file not shown.
2 changes: 1 addition & 1 deletion test/system/buying_an_album_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class BuyingAnAlbumTest < ApplicationSystemTestCase
setup do
sign_in_as(create(:user))
@album = create(:album_with_tracks)
TranscodeJob.perform_now(@album.tracks.first)
@album.tracks.first.transcodes << create(:transcode)
end

test 'viewing the album' do
Expand Down

0 comments on commit 670b86d

Please sign in to comment.