mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
Newznab won't blow up if more than one indexer with the same URL is found during initialization.
This commit is contained in:
@@ -272,5 +272,28 @@ namespace NzbDrone.Core.Test.ProviderTests
|
||||
result.Should().HaveCount(1);
|
||||
result.First().BuiltIn.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InitializeNewznabIndexers_should_not_blow_up_if_more_than_one_indexer_with_the_same_url_is_found()
|
||||
{
|
||||
//Setup
|
||||
var definition = Builder<NewznabDefinition>.CreateNew()
|
||||
.With(d => d.Url = "http://www.nzbdrone2.com")
|
||||
.With(d => d.BuiltIn = false)
|
||||
.Build();
|
||||
|
||||
var db = TestDbHelper.GetEmptyDatabase();
|
||||
Mocker.SetConstant(db);
|
||||
|
||||
db.Insert(definition);
|
||||
db.Insert(definition);
|
||||
|
||||
//Act
|
||||
Mocker.Resolve<NewznabProvider>().InitializeNewznabIndexers(new List<NewznabDefinition> { definition });
|
||||
|
||||
//Assert
|
||||
var result = db.Fetch<NewznabDefinition>();
|
||||
result.Should().HaveCount(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user