Github PR #2935 - Fixes #2781 - Users can't remove their Sessions from Device list.

This commit is contained in:
Mantas Masalskis 2020-02-19 12:43:58 +01:00 committed by Thorsten Eckel
parent 55db5688f1
commit c7ab3e1fe2
2 changed files with 19 additions and 1 deletions

View file

@ -36,7 +36,7 @@ class Index extends App.ControllerSubContent
delete: (e) =>
e.preventDefault()
id = $(e.target).closest('a').data('device-id')
id = $(e.target).closest('div').data('device-id')
@ajax(
id: 'user_devices_delete'

View file

@ -0,0 +1,18 @@
require 'rails_helper'
RSpec.describe 'Profile > Devices', type: :system, authenticated: true do
subject!(:device) { create(:user_device, user_id: User.find_by(login: 'master@example.com').id) }
it 'allows to remove device' do
visit 'profile/devices'
within(:active_content) do
find('td', text: device.name)
.ancestor('tr')
.find('.settings-list-control')
.click
end
wait(5).until { expect(page).to have_no_css('td', text: device.name) }
end
end