Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,20 @@ await configure(opts =>
(await theHost.GetAsText("/tenant/both/cornflower")).ShouldBe("cornflower");
}

[Fact]
public async Task working_with_form_data()
{
await configure(opts =>
{
opts.TenantId.IsRouteArgumentNamed("tenant");
opts.TenantId.AssertExists();
});

var formData = new Dictionary<string, string> { { "value", "blue" } };
var result = await theHost.Scenario(x => x.Post.FormData(formData).ToUrl("/tenant/red/formdata"));
result.ReadAsText().ShouldBe("red");
}

[Fact]
public async Task does_tag_current_activity_with_tenant_id()
{
Expand Down Expand Up @@ -437,6 +451,14 @@ public static string GetTenantWithArgs1(IMessageContext context, IMessageBus bus
bus.TenantId.ShouldBe(context.TenantId);
return context.TenantId;
}

// in this combination, TenantId needs the [FromServices] attribute, otherwise codegen tries to
// parse it from the JSON body and the request fails with HTTP error 415
[WolverinePost("/tenant/{tenant}/formdata")]
public static string GetTenantIdWithFormData([FromForm] String value, TenantId tenantId)
{
return tenantId.Value;
}

#region sample_using_NotTenanted

Expand Down
Loading