Exemplo n.º 1
0
        public void Should_be_able_to_select_form_with_selector_using_load()
        {
            Execute(client =>
            {
                var payload = new MultipleFormsPayload
                {
                    Form1 = "form1",
                    Form2 = "form2"
                };

                var response = client.Load(CrowbarRoute.MultipleForms.AsOutbound()).Submit(payload, overrides: (form, model) =>
                {
                    form.Find("input[type='hidden']").Val(payload.Form2);
                }, selector: "form.js-form2");

                response.ShouldHaveStatusCode(HttpStatusCode.OK);
            });
        }
Exemplo n.º 2
0
        public void Should_be_able_to_select_form_with_selector_using_render()
        {
            Execute(client =>
            {
                var payload = new MultipleFormsPayload
                {
                    Form1 = "form1",
                    Form2 = "form2"
                };

                var response = client.Render("~/Views/Partials/_MultipleForms.cshtml", payload).Submit(selector: "form.js-form2");
                response.ShouldHaveStatusCode(HttpStatusCode.OK);
            });
        }
Exemplo n.º 3
0
 public ActionResult FormSelector_Post(MultipleFormsPayload payload)
 {
     return Assert(() => payload.Form1 == null && payload.Form2 == "form2");
 }