mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 05:28:15 +08:00
* #463 save both files * #463 made it so we dont save to disk on startup unless using admin api
This commit is contained in:
@ -276,9 +276,23 @@ namespace Ocelot.IntegrationTests
|
||||
.And(x => ThenTheResponseShouldBe(updatedConfiguration))
|
||||
.When(x => WhenIGetUrlOnTheApiGateway("/administration/configuration"))
|
||||
.And(x => ThenTheResponseShouldBe(updatedConfiguration))
|
||||
.And(_ => ThenTheConfigurationIsSavedCorrectly(updatedConfiguration))
|
||||
.BDDfy();
|
||||
}
|
||||
|
||||
private void ThenTheConfigurationIsSavedCorrectly(FileConfiguration expected)
|
||||
{
|
||||
var ocelotJsonPath = $"{AppContext.BaseDirectory}ocelot.json";
|
||||
var resultText = File.ReadAllText(ocelotJsonPath);
|
||||
var expectedText = JsonConvert.SerializeObject(expected, Formatting.Indented);
|
||||
resultText.ShouldBe(expectedText);
|
||||
|
||||
var environmentSpecificPath = $"{AppContext.BaseDirectory}/ocelot.Production.json";
|
||||
resultText = File.ReadAllText(environmentSpecificPath);
|
||||
expectedText = JsonConvert.SerializeObject(expected, Formatting.Indented);
|
||||
resultText.ShouldBe(expectedText);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void should_get_file_configuration_edit_and_post_updated_version_redirecting_reroute()
|
||||
{
|
||||
|
Reference in New Issue
Block a user