]> git.openstreetmap.org Git - rails.git/blobdiff - test/system/account_pd_declaration_test.rb
Move edit account action to show
[rails.git] / test / system / account_pd_declaration_test.rb
index 9471c28c16af02cc3c36ee08a06bcdf536590b78..d58484c8c3b81d7d9cb597439628567267636df8 100644 (file)
@@ -6,11 +6,30 @@ class AccountPdDeclarationTest < ApplicationSystemTestCase
     sign_in_as(@user)
   end
 
-  test "show checkbox if no declaration was made" do
+  test "can decline declaration if no declaration was made" do
     visit account_pd_declaration_path
 
     within_content_body do
       assert_unchecked_field "I consider my contributions to be in the Public Domain"
+      assert_button "Confirm"
+
+      click_on "Confirm"
+
+      assert_no_text "You have also declared that you consider your edits to be in the Public Domain."
+    end
+  end
+
+  test "can confirm declaration if no declaration was made" do
+    visit account_pd_declaration_path
+
+    within_content_body do
+      assert_unchecked_field "I consider my contributions to be in the Public Domain"
+      assert_button "Confirm"
+
+      check "I consider my contributions to be in the Public Domain"
+      click_on "Confirm"
+
+      assert_text "You have also declared that you consider your edits to be in the Public Domain."
     end
   end
 
@@ -21,6 +40,7 @@ class AccountPdDeclarationTest < ApplicationSystemTestCase
 
     within_content_body do
       assert_checked_field "I consider my contributions to be in the Public Domain", :disabled => true
+      assert_button "Confirm", :disabled => true
     end
   end
 end