Merge pull request from GHSA-vp5r-5pgw-jwqx
* Fix streaming sessions not being closed when revoking access to an app * Add tests for GHSA-7w3c-p9j8-mq3x
This commit is contained in:
parent
b730147618
commit
395f17ca17
4 changed files with 21 additions and 4 deletions
|
@ -147,14 +147,22 @@ describe Settings::ApplicationsController do
|
|||
end
|
||||
|
||||
describe 'destroy' do
|
||||
let(:redis_pipeline_stub) { instance_double(Redis::Namespace, publish: nil) }
|
||||
let!(:access_token) { Fabricate(:accessible_access_token, application: app) }
|
||||
|
||||
before do
|
||||
allow(redis).to receive(:pipelined).and_yield(redis_pipeline_stub)
|
||||
post :destroy, params: { id: app.id }
|
||||
end
|
||||
|
||||
it 'redirects back to applications page and removes the app' do
|
||||
it 'redirects back to applications page removes the app' do
|
||||
expect(response).to redirect_to(settings_applications_path)
|
||||
expect(Doorkeeper::Application.find_by(id: app.id)).to be_nil
|
||||
end
|
||||
|
||||
it 'sends a session kill payload to the streaming server' do
|
||||
expect(redis_pipeline_stub).to have_received(:publish).with("timeline:access_token:#{access_token.id}", '{"event":"kill"}')
|
||||
end
|
||||
end
|
||||
|
||||
describe 'regenerate' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue