mirror of
https://github.com/kikobar/mastodon.git
synced 2024-11-16 20:22:18 +00:00
Combine double subject in api/v1/media
shared example (#28943)
This commit is contained in:
parent
5fbdb2055b
commit
09a3493fca
|
@ -76,20 +76,14 @@ RSpec.describe 'Media' do
|
|||
let(:params) { {} }
|
||||
|
||||
shared_examples 'a successful media upload' do |media_type|
|
||||
it 'uploads the file successfully', :aggregate_failures do
|
||||
it 'uploads the file successfully and returns correct media content', :aggregate_failures do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(MediaAttachment.first).to be_present
|
||||
expect(MediaAttachment.first).to have_attached_file(:file)
|
||||
end
|
||||
|
||||
it 'returns the correct media content' do
|
||||
subject
|
||||
|
||||
body = body_as_json
|
||||
|
||||
expect(body).to match(
|
||||
expect(body_as_json).to match(
|
||||
a_hash_including(id: MediaAttachment.first.id.to_s, description: params[:description], type: media_type)
|
||||
)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue