]> git.openstreetmap.org Git - rails.git/blob - test/system/account_pd_declaration_test.rb
Add frozen_string_literal comments to ruby files
[rails.git] / test / system / account_pd_declaration_test.rb
1 # frozen_string_literal: true
2
3 require "application_system_test_case"
4
5 class AccountPdDeclarationTest < ApplicationSystemTestCase
6   def setup
7     @user = create(:user, :display_name => "test user")
8     sign_in_as(@user)
9   end
10
11   test "can decline declaration if no declaration was made" do
12     visit account_pd_declaration_path
13
14     within_content_body do
15       assert_unchecked_field "I consider my contributions to be in the Public Domain"
16       assert_button "Confirm"
17
18       click_on "Confirm"
19
20       assert_no_text "You have also declared that you consider your edits to be in the Public Domain."
21     end
22   end
23
24   test "can confirm declaration if no declaration was made" do
25     visit account_pd_declaration_path
26
27     within_content_body do
28       assert_unchecked_field "I consider my contributions to be in the Public Domain"
29       assert_button "Confirm"
30
31       check "I consider my contributions to be in the Public Domain"
32       click_on "Confirm"
33
34       assert_text "You have also declared that you consider your edits to be in the Public Domain."
35     end
36   end
37
38   test "show disabled checkbox if declaration was made" do
39     @user.update(:consider_pd => true)
40
41     visit account_pd_declaration_path
42
43     within_content_body do
44       assert_checked_field "I consider my contributions to be in the Public Domain", :disabled => true
45       assert_button "Confirm", :disabled => true
46     end
47   end
48 end