Skip to content

Commit

Permalink
fix(settings): Rename changeSettings in setSettings (#462)
Browse files Browse the repository at this point in the history
Closes #452
  • Loading branch information
ElPicador committed Feb 15, 2018
1 parent f0f8bd0 commit e77f6ee
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,19 @@ trait IndexSettingsDsl {

}

@deprecated("use setSettings", "1.27.1")
case object changeSettings {

def of(index: String) = IndexSettingsDefinition(index)

}

case object setSettings {

def of(index: String) = IndexSettingsDefinition(index)

}

implicit object IndexSettingsDefinitionExecutable
extends Executable[IndexSettingsDefinition, IndexSettings] {
override def apply(client: AlgoliaClient, settings: IndexSettingsDefinition)(
Expand Down
10 changes: 5 additions & 5 deletions src/test/scala/algolia/dsl/IndexSettingsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ class IndexSettingsTest extends AlgoliaTest {

}

describe("change settings") {
describe("set settings") {

it("should get settings") {
changeSettings of "index" `with` IndexSettings() and forwardToSlaves
changeSettings of "index" `with` IndexSettings() and forwardToReplicas
it("should set settings") {
setSettings of "index" `with` IndexSettings() and forwardToSlaves
setSettings of "index" `with` IndexSettings() and forwardToReplicas
}

it("should call API") {
Expand All @@ -71,7 +71,7 @@ class IndexSettingsTest extends AlgoliaTest {
requestOptions = None
)

(changeSettings of "test" `with` IndexSettings() and forwardToReplicas).build() should be(
(setSettings of "test" `with` IndexSettings() and forwardToReplicas).build() should be(
payload)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ class IndexSettingsIntegrationTest extends AlgoliaTest {
}
}

it("should update settings") {
it("should set settings") {
val change: Future[Task] = client.execute {
changeSettings of "indexToChangeSettings" `with` IndexSettings(
setSettings of "indexToChangeSettings" `with` IndexSettings(
searchableAttributes = Some(Seq(SearchableAttributes.attribute("att")))
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class SearchIntegrationTest extends AlgoliaTest {

it("should search in facets") {
val change = client.execute {
changeSettings of "indexToSearchFacet" `with` IndexSettings(
setSettings of "indexToSearchFacet" `with` IndexSettings(
attributesForFaceting = Some(Seq("searchable(series)"))
)
}
Expand Down

0 comments on commit e77f6ee

Please sign in to comment.