]> 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 22867c795198fd5718895bb7ff602eddd9adf397..d58484c8c3b81d7d9cb597439628567267636df8 100644 (file)
@@ -6,12 +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