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