X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/62b70f45bc2566d3ca3c0d79c72da7d46d5f49a4..7d6ac34fbcc86f9750ea4590043f12e24b76d057:/test/controllers/accounts/pd_declarations_controller_test.rb?ds=inline diff --git a/test/controllers/accounts/pd_declarations_controller_test.rb b/test/controllers/accounts/pd_declarations_controller_test.rb index 4b961e326..d2bbd70d2 100644 --- a/test/controllers/accounts/pd_declarations_controller_test.rb +++ b/test/controllers/accounts/pd_declarations_controller_test.rb @@ -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