Merge branch 'master' into 9318-dashboard-uses-work-units
[arvados.git] / apps / workbench / test / integration / user_agreements_test.rb
1 require 'integration_helper'
2
3 class UserAgreementsTest < ActionDispatch::IntegrationTest
4
5   setup do
6     need_javascript
7   end
8
9   def continuebutton_selector
10     'input[type=submit][disabled][value=Continue]'
11   end
12
13   test "cannot click continue without ticking checkbox" do
14     visit page_with_token('inactive')
15     assert_selector continuebutton_selector
16   end
17
18   test "continue button is enabled after ticking checkbox" do
19     visit page_with_token('inactive')
20     assert_selector continuebutton_selector
21     find('input[type=checkbox]').click
22     assert_no_selector continuebutton_selector
23     assert_nil(find_button('Continue')[:disabled],
24                'Continue button did not become enabled')
25   end
26
27 end