_G.spy = spy local mock_env = require("spec.env_mock") local rng = require("spec.fuzzgen") describe("smr biography",function() setup(mock_env.setup) teardown(mock_env.teardown) it("should allow users to set their biography",function() local claim_post = require("endpoints.claim_post") local login_post = require("endpoints.login_post") local index_get = require("endpoints.index_get") local bio_get = require("endpoints.bio_get") local bio_post = require("endpoints.bio_post") local db = require("db") local config = require("config") config.domain = "test.host" configure() local username = rng.subdomain() local claim_req = { method = "POST", host = "test.host", path = "/_claim", args = { user = username } } claim_post(claim_req) local login_req = { method = "POST", host = "test.host", path = "/_login", args = { user = username }, file = { pass = claim_req.response } } login_post(login_req) local cookie = login_req.response_headers["set-cookie"] local sessionid = cookie:match("session=([^;]+)") local home_req_get = { method = "GET", host = username .. ".test.host", path = "/", cookies = { session = sessionid } } index_get(home_req_get) local edit_bio_button = '