Test: API呼び出しによってスタンプをつけるテスト (#139)
* Test: API呼び出しによってスタンプをつけるテスト * Fix: スタンプ削除APIで`emoji`パラメータを指定していないときに投稿が自由閲覧できる問題 * Test: さっきの問題のテストを追加
This commit is contained in:
parent
d62a135806
commit
b73eb1b847
3 changed files with 285 additions and 4 deletions
|
@ -3,9 +3,9 @@
|
|||
class Api::V1::Statuses::EmojiReactionsController < Api::BaseController
|
||||
include Authorization
|
||||
|
||||
before_action -> { doorkeeper_authorize! :write, :'write:emoji_reactions' }
|
||||
before_action -> { doorkeeper_authorize! :write, :'write:favourites' }
|
||||
before_action :require_user!
|
||||
before_action :set_status, only: %i(create update destroy)
|
||||
before_action :set_status, only: %i(create update)
|
||||
before_action :set_status_without_authorize, only: [:destroy]
|
||||
|
||||
def create
|
||||
|
@ -28,6 +28,8 @@ class Api::V1::Statuses::EmojiReactionsController < Api::BaseController
|
|||
authorize @status, :show? if emoji_reaction.nil?
|
||||
|
||||
UnEmojiReactService.new.call(current_account.id, @status.id, emoji_reaction) if emoji_reaction.present?
|
||||
else
|
||||
authorize @status, :show?
|
||||
end
|
||||
|
||||
render json: @status, serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue