1 require "application_system_test_case"
 
   3 class AccountPdDeclarationTest < ApplicationSystemTestCase
 
   5     @user = create(:user, :display_name => "test user")
 
   9   test "can decline declaration if no declaration was made" do
 
  10     visit account_pd_declaration_path
 
  12     within_content_body do
 
  13       assert_unchecked_field "I consider my contributions to be in the Public Domain"
 
  14       assert_button "Confirm"
 
  18       assert_no_text "You have also declared that you consider your edits to be in the Public Domain."
 
  22   test "can confirm declaration if no declaration was made" do
 
  23     visit account_pd_declaration_path
 
  25     within_content_body do
 
  26       assert_unchecked_field "I consider my contributions to be in the Public Domain"
 
  27       assert_button "Confirm"
 
  29       check "I consider my contributions to be in the Public Domain"
 
  32       assert_text "You have also declared that you consider your edits to be in the Public Domain."
 
  36   test "show disabled checkbox if declaration was made" do
 
  37     @user.update(:consider_pd => true)
 
  39     visit account_pd_declaration_path
 
  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