1 # frozen_string_literal: true
 
   3 require "application_system_test_case"
 
   5 class AccountPdDeclarationTest < ApplicationSystemTestCase
 
   7     @user = create(:user, :display_name => "test user")
 
  11   test "can decline declaration if no declaration was made" do
 
  12     visit account_pd_declaration_path
 
  14     within_content_body do
 
  15       assert_unchecked_field "I consider my contributions to be in the Public Domain"
 
  16       assert_button "Confirm"
 
  20       assert_no_text "You have also declared that you consider your edits to be in the Public Domain."
 
  24   test "can confirm declaration if no declaration was made" do
 
  25     visit account_pd_declaration_path
 
  27     within_content_body do
 
  28       assert_unchecked_field "I consider my contributions to be in the Public Domain"
 
  29       assert_button "Confirm"
 
  31       check "I consider my contributions to be in the Public Domain"
 
  34       assert_text "You have also declared that you consider your edits to be in the Public Domain."
 
  38   test "show disabled checkbox if declaration was made" do
 
  39     @user.update(:consider_pd => true)
 
  41     visit account_pd_declaration_path
 
  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