summary refs log tree commit diff stats
path: root/doc
Commit message (Expand)AuthorAgeFilesLines
* added symlink: doc/help => ranger/helphut2010-02-281-0/+1
* incremented version number and updated pydoc html files v1.0.3hut2010-02-1675-1972/+1415
* doc/cd-after-exit: updatedhut2010-02-141-21/+15
* doc/pick.sh: corrected commit orderhut2010-02-091-1/+1
* doc: what breaks cd-after-exit support in zshhut2010-02-091-0/+2
* pick.sh: added -m to checkout commadshut2010-02-051-3/+3
* pick.sh: added variables for easier customizationhut2010-02-041-7/+8
* added doc/pick.shhut2010-02-041-0/+24
* updated dochut2010-01-211-4/+20
* 1.0.2! v1.0.2hut2010-01-1430-84/+116
* updated pydoc documentationhut2010-01-1361-846/+795
* todo: added more info on bug #31hut2010-01-091-0/+5
* random cleanups and fixeshut2010-01-071-5/+6
* new minor version v1.0.1hut2010-01-022-4/+4
* updated pydoc documentationhut2010-01-0248-788/+3167
* notify: merged into statusbar, allow to view the log in the pagerhut2010-01-013-35/+2
* cleanupshut2009-12-311-1/+5
* rename filelist(container) to browsercolumn/browserviewhut2009-12-313-38/+76
* updated uml projecthut2009-12-305-73/+215
* shorten comment in ranger.pyhut2009-12-261-0/+4
* moved /uml to /doc/umlhut2009-12-2514-0/+2180
* Explained cd-after-exit featurehut2009-12-251-0/+132
* moved pydoc pages to doc/pydochut2009-12-2565-0/+0
* updated pydoc pageshut2009-12-2565-0/+10505
="w"> "testing" ) var apiPostUserCases = []struct { name string nick string uri string wantErr bool }{ { name: "Known Good User", nick: "soltempore", uri: "https://enotty.dk/soltempore.txt", wantErr: false, }, { name: "Missing URI", nick: "missinguri", uri: "", wantErr: true, }, { name: "Missing Nickname", nick: "", uri: "https://example.com/twtxt.txt", wantErr: true, }, { name: "Missing URI and Nickname", nick: "", uri: "", wantErr: true, }, } func Test_apiPostUser(t *testing.T) { initTestConf() for _, tt := range apiPostUserCases { t.Run(tt.name, func(t *testing.T) { params := url.Values{} params.Set("url", tt.uri) params.Set("nickname", tt.nick) req, err := http.NewRequest("POST", "http://localhost"+testport+"/api/plain/users", strings.NewReader(params.Encode())) if err != nil { t.Errorf("%v\n", err) } req.Header.Add("Content-Type", "application/x-www-form-urlencoded") rr := httptest.NewRecorder() handler := http.HandlerFunc(apiEndpointPOSTHandler) handler.ServeHTTP(rr, req) if !tt.wantErr { if rr.Code != http.StatusOK { t.Errorf("Received unexpected non-200 response: %v\n", rr.Code) } } else { if rr.Code != http.StatusBadRequest { t.Errorf("Expected 400 Bad Request, but received: %v\n", rr.Code) } } }) } }