@ -8,14 +8,14 @@ describe MediaController do
describe '#show' do
describe '#show' do
it 'redirects to the file url when attached to a status' do
it 'redirects to the file url when attached to a status' do
status = Fabricate ( :status )
status = Fabricate ( :status )
media_attachment = Fabricate ( :media_attachment , status : status )
media_attachment = Fabricate ( :media_attachment , status : status , shortcode : 'foo' )
get :show , params : { id : media_attachment . to_param }
get :show , params : { id : media_attachment . to_param }
expect ( response ) . to redirect_to ( media_attachment . file . url ( :original ) )
expect ( response ) . to redirect_to ( media_attachment . file . url ( :original ) )
end
end
it 'responds with missing when there is not an attached status' do
it 'responds with missing when there is not an attached status' do
media_attachment = Fabricate ( :media_attachment , status : nil )
media_attachment = Fabricate ( :media_attachment , status : nil , shortcode : 'foo' )
get :show , params : { id : media_attachment . to_param }
get :show , params : { id : media_attachment . to_param }
expect ( response ) . to have_http_status ( 404 )
expect ( response ) . to have_http_status ( 404 )
@ -29,7 +29,7 @@ describe MediaController do
it 'raises when not permitted to view' do
it 'raises when not permitted to view' do
status = Fabricate ( :status , visibility : :direct )
status = Fabricate ( :status , visibility : :direct )
media_attachment = Fabricate ( :media_attachment , status : status )
media_attachment = Fabricate ( :media_attachment , status : status , shortcode : 'foo' )
get :show , params : { id : media_attachment . to_param }
get :show , params : { id : media_attachment . to_param }
expect ( response ) . to have_http_status ( 404 )
expect ( response ) . to have_http_status ( 404 )