mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
Newznab won't blow up if more than one indexer with the same URL is found during initialization.
This commit is contained in:
parent
b930eb0993
commit
a16defc5f0
2 changed files with 24 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue