diff options
author | Heiko Bernlöhr <Heiko.Bernloehr@FreeIT.de> | 2021-12-20 23:54:14 +0100 |
---|---|---|
committer | Heiko Bernlöhr <Heiko.Bernloehr@FreeIT.de> | 2022-09-15 10:02:02 +0200 |
commit | e711dad7c743150916758b821b53e7caeff2b15d (patch) | |
tree | 3c5cf04d219e73edbde119e15bf06e40dcc8bb02 | |
parent | 73bd4cbe0ff19247c9f041a6a482e38ae2cefc9c (diff) | |
download | ecs-e711dad7c743150916758b821b53e7caeff2b15d.tar.gz ecs-e711dad7c743150916758b821b53e7caeff2b15d.zip |
Fix message controller test.
-rw-r--r-- | test/controllers/messages_controller_test.rb | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/test/controllers/messages_controller_test.rb b/test/controllers/messages_controller_test.rb index 24cc5d5..2045ebc 100644 --- a/test/controllers/messages_controller_test.rb +++ b/test/controllers/messages_controller_test.rb @@ -443,20 +443,15 @@ public end -# test "create_auths_invalid_json_body" do -# mm_count = MembershipMessage.all.count -# myrequest("post", :create, -# "/sys/auths", -# { -# "X-EcsAuthId" => identities(:stgt_id1).name, -# "X-EcsReceiverMemberships" => memberships(:ulm_wuv).id.to_s, -# "CONTENT_TYPE" => "application/json", -# "RAW_POST_DATA" => '{"realm"::"https://ilias.uni-stuttgart.de/goto.php?target=crs_95034&client_id=USTGT"}' -# } -# ) -# assert_response 400 -# assert_equal "Invalid JSON body", assigns(:http_error).to_s -# end + test "create_auths_invalid_json_body" do + request.headers["X-EcsAuthId"] = identities(:stgt_id1).name + request.headers["X-EcsReceiverMemberships"] = memberships(:ulm_wuv).id.to_s + request.headers["CONTENT_TYPE"] = "application/json" + request.path = "/sys/auths" + post :create, body: '{"realm"::"https://ilias.uni-stuttgart.de/goto.php?target=crs_95034&client_id=USTGT"}' + assert_response 400 + assert_equal "Invalid JSON body", assigns(:http_error).to_s + end test "create_auths_eov_younger_than_sov" do raw_post_data = <<-'HERE' @@ -508,6 +503,7 @@ public assert_equal "eov time is too young", assigns(:http_error).to_s end +# FIXME test delete auths # test "delete_auths" do # #@request.headers["X-EcsAuthId"] = identities(:ulm_id1).name # #@request.set_REQUEST_URI("/sys/auths/#{auths(:valid).one_touch_hash}") |