@@ -1554,11 +1554,11 @@ main = hspec $ do
1554 scan_search `shouldMatchList` [Just exampleTweet, Just otherTweet]
1554 scan_search `shouldMatchList` [Just exampleTweet, Just otherTweet]
1556 describe "index aliases" $ do
1556 describe "index aliases" $ do
1557+ let aname = IndexAliasName (IndexName "bloodhound-tests-twitter-1-alias")
1558+ let alias = IndexAlias (testIndex) aname
1559+ let create = IndexAliasCreate Nothing Nothing
1560+ let action = AddAlias alias create
1557 it "handles the simple case of aliasing an existing index" $ do
1561 it "handles the simple case of aliasing an existing index" $ do
1558− let alias = IndexAlias (testIndex) (IndexAliasName (IndexName "bloodhound-tests-twitter-1-alias"))
1559− let create = IndexAliasCreate Nothing Nothing
1560− let action = AddAlias alias create
1562 withTestEnv $ do
1562 withTestEnv $ do
1563 resetIndex
1563 resetIndex
1564 resp <- updateIndexAliases (action :| [])
1564 resp <- updateIndexAliases (action :| [])
@@ -1570,6 +1570,18 @@ main = hspec $ do
1570 Right (IndexAliasesSummary summs) ->
1570 Right (IndexAliasesSummary summs) ->
1571 L.find ((== alias) . indexAliasSummaryAlias) summs `shouldBe` Just expected
1571 L.find ((== alias) . indexAliasSummaryAlias) summs `shouldBe` Just expected
1572 Left e -> expectationFailure ("Expected an IndexAliasesSummary but got " <> show e)) `finally` cleanup
1572 Left e -> expectationFailure ("Expected an IndexAliasesSummary but got " <> show e)) `finally` cleanup
1573+ it "allows alias deletion" $ do
1574+ aliases <- withTestEnv $ do
1576+ resp <- updateIndexAliases (action :| [])
1577+ liftIO $ validateStatus resp 200
1578+ deleteIndexAlias aname
1580+ let expected = IndexAliasSummary alias create
1582+ Right (IndexAliasesSummary summs) ->
1583+ L.find ((== aname) . indexAlias . indexAliasSummaryAlias) summs `shouldBe` Nothing
1584+ Left e -> expectationFailure ("Expected an IndexAliasesSummary but got " <> show e)
1574 describe "Index Listing" $ do
1586 describe "Index Listing" $ do
1575 it "returns a list of index names" $ withTestEnv $ do
1587 it "returns a list of index names" $ withTestEnv $ do