]> git.openstreetmap.org Git - rails.git/blob - test/system/account_pd_declaration_test.rb
Add confirm button to pd declaration page
[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 "show checkbox 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     end
16   end
17
18   test "show disabled checkbox if declaration was made" do
19     @user.update(:consider_pd => true)
20
21     visit account_pd_declaration_path
22
23     within_content_body do
24       assert_checked_field "I consider my contributions to be in the Public Domain", :disabled => true
25       assert_button "Confirm", :disabled => true
26     end
27   end
28 end