mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Merge commit from fork
This commit is contained in:
parent
6698901d57
commit
1b3ef035b9
2 changed files with 4 additions and 3 deletions
|
|
@ -62,7 +62,7 @@ class Api::Web::PushSubscriptionsController < Api::Web::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_push_subscription
|
def set_push_subscription
|
||||||
@push_subscription = ::Web::PushSubscription.find(params[:id])
|
@push_subscription = ::Web::PushSubscription.where(user_id: active_session.user_id).find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def subscription_params
|
def subscription_params
|
||||||
|
|
|
||||||
|
|
@ -163,9 +163,10 @@ RSpec.describe 'API Web Push Subscriptions' do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'PUT /api/web/push_subscriptions/:id' do
|
describe 'PUT /api/web/push_subscriptions/:id' do
|
||||||
before { sign_in Fabricate :user }
|
before { sign_in user }
|
||||||
|
|
||||||
let(:subscription) { Fabricate :web_push_subscription }
|
let(:user) { Fabricate(:user) }
|
||||||
|
let(:subscription) { Fabricate(:web_push_subscription, user: user) }
|
||||||
|
|
||||||
it 'gracefully handles invalid nested params' do
|
it 'gracefully handles invalid nested params' do
|
||||||
put api_web_push_subscription_path(subscription), params: { data: 'invalid' }
|
put api_web_push_subscription_path(subscription), params: { data: 'invalid' }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue