This commit is contained in:
parent
55db5688f1
commit
c7ab3e1fe2
2 changed files with 19 additions and 1 deletions
|
@ -36,7 +36,7 @@ class Index extends App.ControllerSubContent
|
||||||
|
|
||||||
delete: (e) =>
|
delete: (e) =>
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
id = $(e.target).closest('a').data('device-id')
|
id = $(e.target).closest('div').data('device-id')
|
||||||
|
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'user_devices_delete'
|
id: 'user_devices_delete'
|
||||||
|
|
18
spec/system/profile/devices_spec.rb
Normal file
18
spec/system/profile/devices_spec.rb
Normal 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
|
Loading…
Reference in a new issue