update capybara specs for subscription toggle
This commit is contained in:
parent
bd2e524f4d
commit
2525513cfd
|
@ -334,14 +334,14 @@ describe 'Issue Boards', :js do
|
|||
wait_for_requests
|
||||
|
||||
page.within('.subscriptions') do
|
||||
click_button 'Subscribe'
|
||||
find('.js-issuable-subscribe-button button:not(.is-checked)').click
|
||||
wait_for_requests
|
||||
|
||||
expect(page).to have_content('Unsubscribe')
|
||||
expect(page).to have_css('.js-issuable-subscribe-button button.is-checked')
|
||||
end
|
||||
end
|
||||
|
||||
it 'has "Unsubscribe" button when already subscribed' do
|
||||
it 'has checked subscription toggle when already subscribed' do
|
||||
create(:subscription, user: user, project: project, subscribable: issue2, subscribed: true)
|
||||
visit project_board_path(project, board)
|
||||
wait_for_requests
|
||||
|
@ -350,10 +350,10 @@ describe 'Issue Boards', :js do
|
|||
wait_for_requests
|
||||
|
||||
page.within('.subscriptions') do
|
||||
click_button 'Unsubscribe'
|
||||
find('.js-issuable-subscribe-button button.is-checked').click
|
||||
wait_for_requests
|
||||
|
||||
expect(page).to have_content('Subscribe')
|
||||
expect(page).to have_css('.js-issuable-subscribe-button button:not(.is-checked)')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,20 +13,18 @@ describe 'User manages subscription', :js do
|
|||
end
|
||||
|
||||
it 'toggles subscription' do
|
||||
subscribe_button = find('.js-issuable-subscribe-button')
|
||||
|
||||
expect(subscribe_button).to have_content('Subscribe')
|
||||
|
||||
click_on('Subscribe')
|
||||
page.within('.js-issuable-subscribe-button') do
|
||||
expect(page).to have_css 'button:not(.is-checked)'
|
||||
find('button:not(.is-checked)').click
|
||||
|
||||
wait_for_requests
|
||||
|
||||
expect(subscribe_button).to have_content('Unsubscribe')
|
||||
|
||||
click_on('Unsubscribe')
|
||||
expect(page).to have_css 'button.is-checked'
|
||||
find('button.is-checked').click
|
||||
|
||||
wait_for_requests
|
||||
|
||||
expect(subscribe_button).to have_content('Subscribe')
|
||||
expect(page).to have_css 'button:not(.is-checked)'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue