feat: common attachment endpoint follow-up changes (#7826)
This commit is contained in:
@@ -259,23 +259,5 @@ RSpec.describe 'Api::V1::Accounts::Articles', type: :request do
|
||||
expect(json_response['payload']['id']).to eq(root_article.id)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'Upload an image' do
|
||||
let(:article) { create(:article, account_id: account.id, category_id: category.id, portal_id: portal.id, author_id: agent.id) }
|
||||
|
||||
it 'update the article with an image' do
|
||||
file = fixture_file_upload(Rails.root.join('spec/assets/avatar.png'), 'image/png')
|
||||
|
||||
post "/api/v1/accounts/#{account.id}/portals/#{article.portal.slug}/articles/attach_file",
|
||||
headers: agent.create_new_auth_token,
|
||||
params: { background_image: file }
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
|
||||
blob = response.parsed_body
|
||||
|
||||
expect(blob['file_url']).to be_present
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user