Finish the unit test to check anonymous posting works.
Finish up a unit test that was previously marked TODO, which tests that a story posted anonymously appears on the home page.
This commit is contained in:
parent
f0c7ae13fe
commit
f5c729bfde
|
@ -1,6 +1,7 @@
|
||||||
_G.spy = spy
|
_G.spy = spy
|
||||||
local mock_env = require("spec.env_mock")
|
local mock_env = require("spec.env_mock")
|
||||||
local fuzzy = require("spec.fuzzgen")
|
local fuzzy = require("spec.fuzzgen")
|
||||||
|
require("spec.utils")
|
||||||
|
|
||||||
describe("smr",function()
|
describe("smr",function()
|
||||||
setup(mock_env.setup)
|
setup(mock_env.setup)
|
||||||
|
@ -35,6 +36,8 @@ describe("smr",function()
|
||||||
}
|
}
|
||||||
index_get(get_req)
|
index_get(get_req)
|
||||||
assert.stub(pages_mock.index).was_called()
|
assert.stub(pages_mock.index).was_called()
|
||||||
pending("TODO")
|
assertf(get_req.responsecode >= 200 and get_req.responsecode < 300, "Should give a 2XX response code, got %d", get_req.responsecode)
|
||||||
|
assert(get_req.responsecode == 200, "Error code should be 200 - OK")
|
||||||
|
assert(get_req.response:find(get_req.response,1,true), "Failed to find title in string")
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue