public async Task should_reply_a_topic_by_an_authorized_user() { _theApp.MockUser(); var(topic, userId) = ReplyControllerSpecs.CreateTopic(_theApp); var response = await RequestToCreateReply(_theApp, topic.Id); response.StatusCode.ShouldEqual(HttpStatusCode.NoContent); }
public async Task should_not_be_able_to_reply_a_topic_by_anonymous_user() { _theApp.MockUser(); var(topic, userId) = ReplyControllerSpecs.CreateTopic(_theApp); _theApp.Reset(); var response = await RequestToCreateReply(_theApp, topic.Id); response.StatusCode.ShouldEqual(HttpStatusCode.Redirect); response.Headers.Location.ToString().Contains("signin").ShouldEqual(true); }