1 require 'integration_helper'
2 require 'selenium-webdriver'
5 class UserAgreementsTest < ActionDispatch::IntegrationTest
8 Capybara.current_driver = Capybara.javascript_driver
11 def continuebutton_selector
12 'input[type=submit][disabled][value=Continue]'
15 test "cannot click continue without ticking checkbox" do
16 visit page_with_token('inactive')
17 assert_selector continuebutton_selector
20 test "continue button is enabled after ticking checkbox" do
21 visit page_with_token('inactive')
22 assert_selector continuebutton_selector
23 find('input[type=checkbox]').click
24 assert_no_selector continuebutton_selector
25 assert_nil(find_button('Continue')[:disabled],
26 'Continue button did not become enabled')