0
0
Fork 0

Fixing image upload limits, allowing webm, merge/unmerge events trigger

timeline reload in UI, other small fixes
This commit is contained in:
Eugen Rochko 2016-09-12 18:22:43 +02:00
parent 3d566279cb
commit ce29624c6d
15 changed files with 144 additions and 61 deletions

View file

@ -11,24 +11,48 @@ RSpec.describe Api::MediaController, type: :controller do
end
describe 'POST #create' do
before do
post :create, params: { file: fixture_file_upload('files/attachment.jpg', 'image/jpeg') }
context 'image/jpeg' do
before do
post :create, params: { file: fixture_file_upload('files/attachment.jpg', 'image/jpeg') }
end
it 'returns http success' do
expect(response).to have_http_status(:success)
end
it 'creates a media attachment' do
expect(MediaAttachment.first).to_not be_nil
end
it 'uploads a file' do
expect(MediaAttachment.first).to have_attached_file(:file)
end
it 'returns media ID in JSON' do
expect(body_as_json[:id]).to eq MediaAttachment.first.id
end
end
it 'returns http success' do
expect(response).to have_http_status(:success)
end
context 'video/webm' do
before do
post :create, params: { file: fixture_file_upload('files/attachment.webm', 'video/webm') }
end
it 'creates a media attachment' do
expect(MediaAttachment.first).to_not be_nil
end
xit 'returns http success' do
expect(response).to have_http_status(:success)
end
it 'uploads a file' do
expect(MediaAttachment.first).to have_attached_file(:file)
end
xit 'creates a media attachment' do
expect(MediaAttachment.first).to_not be_nil
end
it 'returns media ID in JSON' do
expect(body_as_json[:id]).to eq MediaAttachment.first.id
xit 'uploads a file' do
expect(MediaAttachment.first).to have_attached_file(:file)
end
xit 'returns media ID in JSON' do
expect(body_as_json[:id]).to eq MediaAttachment.first.id
end
end
end
end