From 63002cde03a836b4510aca5da564504ecaedb5e9 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 10 Feb 2022 00:15:30 +0100 Subject: Add editing for published statuses (#17320) * Add editing for published statuses * Fix change of multiple-choice boolean in poll not resetting votes * Remove the ability to update existing media attachments for now --- spec/controllers/api/v1/statuses_controller_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'spec/controllers/api/v1/statuses_controller_spec.rb') diff --git a/spec/controllers/api/v1/statuses_controller_spec.rb b/spec/controllers/api/v1/statuses_controller_spec.rb index 2679ab017..190dfad11 100644 --- a/spec/controllers/api/v1/statuses_controller_spec.rb +++ b/spec/controllers/api/v1/statuses_controller_spec.rb @@ -102,6 +102,23 @@ RSpec.describe Api::V1::StatusesController, type: :controller do expect(Status.find_by(id: status.id)).to be nil end end + + describe 'PUT #update' do + let(:scopes) { 'write:statuses' } + let(:status) { Fabricate(:status, account: user.account) } + + before do + put :update, params: { id: status.id, status: 'I am updated' } + end + + it 'returns http success' do + expect(response).to have_http_status(200) + end + + it 'updates the status' do + expect(status.reload.text).to eq 'I am updated' + end + end end context 'without an oauth token' do -- cgit