]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/accounts/pd_declarations_controller_test.rb
Add pd declaration create action
[rails.git] / test / controllers / accounts / pd_declarations_controller_test.rb
index 4b961e3268e44b112c1c1cf2b6b8cbf45d675bda..d2bbd70d2480b4e6f65a0d9d2379aa909bfb2b41 100644 (file)
@@ -9,6 +9,10 @@ module Accounts
         { :path => "/account/pd_declaration", :method => :get },
         { :controller => "accounts/pd_declarations", :action => "show" }
       )
+      assert_routing(
+        { :path => "/account/pd_declaration", :method => :post },
+        { :controller => "accounts/pd_declarations", :action => "create" }
+      )
     end
 
     def test_show_not_logged_in
@@ -25,5 +29,20 @@ module Accounts
 
       assert_response :success
     end
+
+    def test_create_not_logged_in
+      post account_pd_declaration_path
+
+      assert_response :forbidden
+    end
+
+    def test_create
+      user = create(:user)
+      session_for(user)
+
+      post account_pd_declaration_path
+
+      assert_redirected_to edit_account_path
+    end
   end
 end