Save track files in new Sound model:
* Consolidate migrations * Add Sound model. Each sound can belong to a track and contains informations about one sound file.
This commit is contained in:
25
spec/controllers/sounds_controller_spec.rb
Normal file
25
spec/controllers/sounds_controller_spec.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe SoundsController do
|
||||
before do
|
||||
controller.current_user = Factory.create(:user)
|
||||
end
|
||||
|
||||
describe 'GET show' do
|
||||
let(:sound) { Factory.create(:sound) }
|
||||
|
||||
def do_show
|
||||
get :show, :id => sound.id
|
||||
end
|
||||
|
||||
it 'sends the sound file as the response body' do
|
||||
do_show
|
||||
response.body.should == File.read(sound.path)
|
||||
end
|
||||
|
||||
it 'sets the sound file mime-type as the response content-type' do
|
||||
do_show
|
||||
response.content_type.should == sound.mime_type
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user