|
|
|
@ -67,8 +67,6 @@ func main() { |
|
|
|
ExpectJson("Payload", "Bad request: note length not accepted") |
|
|
|
ExpectJson("Payload", "Bad request: note length not accepted") |
|
|
|
|
|
|
|
|
|
|
|
testNote := "# Hello World!\nThis is a _test_ note!" |
|
|
|
testNote := "# Hello World!\nThis is a _test_ note!" |
|
|
|
testNoteHTML := "<h1>Hello World!</h1>\n<p>This is a <em>test</em> note!</p>" |
|
|
|
|
|
|
|
var id string |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tooLongNote := testNote |
|
|
|
tooLongNote := testNote |
|
|
|
for len(tooLongNote) < 50000 { |
|
|
|
for len(tooLongNote) < 50000 { |
|
|
|
@ -84,6 +82,7 @@ func main() { |
|
|
|
ExpectJson("Success", false). |
|
|
|
ExpectJson("Success", false). |
|
|
|
ExpectJson("Payload", "Bad request: note length not accepted") |
|
|
|
ExpectJson("Payload", "Bad request: note length not accepted") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var id string |
|
|
|
frisby.Create("Test publishing: correct inputs; no password"). |
|
|
|
frisby.Create("Test publishing: correct inputs; no password"). |
|
|
|
Post(service+"/"). |
|
|
|
Post(service+"/"). |
|
|
|
SetData("tos", "on"). |
|
|
|
SetData("tos", "on"). |
|
|
|
@ -100,6 +99,7 @@ func main() { |
|
|
|
id = noteID |
|
|
|
id = noteID |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
testNoteHTML := "<h1>Hello World!</h1>\n<p>This is a <em>test</em> note!</p>" |
|
|
|
frisby.Create("Test retrieval of new note"). |
|
|
|
frisby.Create("Test retrieval of new note"). |
|
|
|
Get(service + "/" + id). |
|
|
|
Get(service + "/" + id). |
|
|
|
Send(). |
|
|
|
Send(). |
|
|
|
@ -118,18 +118,18 @@ func main() { |
|
|
|
ExpectHeader("Content-type", "text/plain; charset=UTF-8"). |
|
|
|
ExpectHeader("Content-type", "text/plain; charset=UTF-8"). |
|
|
|
ExpectContent(testNote) |
|
|
|
ExpectContent(testNote) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
frisby.Create("Test opening fake service on note"). |
|
|
|
|
|
|
|
Get(service + "/" + id + "/asd"). |
|
|
|
|
|
|
|
Send(). |
|
|
|
|
|
|
|
ExpectStatus(404). |
|
|
|
|
|
|
|
ExpectContent("Not Found") |
|
|
|
|
|
|
|
|
|
|
|
// TODO: fix this
|
|
|
|
// TODO: fix this
|
|
|
|
// frisby.Create("Test opening fake service on note").
|
|
|
|
|
|
|
|
// Get(service + "/" + id + "/asd").
|
|
|
|
|
|
|
|
// Send().
|
|
|
|
|
|
|
|
// ExpectStatus(404).
|
|
|
|
|
|
|
|
// PrintBody().
|
|
|
|
|
|
|
|
// ExpectContent("Not found")
|
|
|
|
|
|
|
|
// frisby.Create("Test opening fake service on note 2").
|
|
|
|
// frisby.Create("Test opening fake service on note 2").
|
|
|
|
// Get(service + "/" + id + "/exports").
|
|
|
|
// Get(service + "/" + id + "/exports").
|
|
|
|
// Send().
|
|
|
|
// Send().
|
|
|
|
// ExpectStatus(404).
|
|
|
|
// ExpectStatus(404).
|
|
|
|
// ExpectContent("Not found")
|
|
|
|
// ExpectContent("Not Found")
|
|
|
|
|
|
|
|
|
|
|
|
frisby.Create("Test stats of new note"). |
|
|
|
frisby.Create("Test stats of new note"). |
|
|
|
Get(service + "/" + id + "/stats"). |
|
|
|
Get(service + "/" + id + "/stats"). |
|
|
|
|