mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	channel: Remove PATCH as POST workaround.
Fixes part of #1403. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							8f6c376835
						
					
				
				
					commit
					c1a95b8ed6
				
			@@ -90,8 +90,7 @@ test("patch", () => {
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
        check_ajax_options(options) {
 | 
			
		||||
            assert.equal(options.type, "POST");
 | 
			
		||||
            assert.equal(options.data.method, "PATCH");
 | 
			
		||||
            assert.equal(options.type, "PATCH");
 | 
			
		||||
            assert.equal(options.dataType, "json");
 | 
			
		||||
 | 
			
		||||
            // Just make sure these don't explode.
 | 
			
		||||
@@ -197,38 +196,6 @@ test("normal_post", () => {
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test("patch_with_form_data", () => {
 | 
			
		||||
    let appended;
 | 
			
		||||
 | 
			
		||||
    const data = {
 | 
			
		||||
        append(k, v) {
 | 
			
		||||
            assert.equal(k, "method");
 | 
			
		||||
            assert.equal(v, "PATCH");
 | 
			
		||||
            appended = true;
 | 
			
		||||
        },
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    test_with_mock_ajax({
 | 
			
		||||
        run_code() {
 | 
			
		||||
            channel.patch({
 | 
			
		||||
                data,
 | 
			
		||||
                url: "/json/endpoint",
 | 
			
		||||
                processData: false,
 | 
			
		||||
            });
 | 
			
		||||
            assert.ok(appended);
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
        check_ajax_options(options) {
 | 
			
		||||
            assert.equal(options.type, "POST");
 | 
			
		||||
            assert.equal(options.dataType, "json");
 | 
			
		||||
 | 
			
		||||
            // Just make sure these don't explode.
 | 
			
		||||
            options.simulate_success();
 | 
			
		||||
            options.simulate_error();
 | 
			
		||||
        },
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test("authentication_error_401_is_spectator", () => {
 | 
			
		||||
    test_with_mock_ajax({
 | 
			
		||||
        xhr: xhr_401,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user