Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- fixed a logic flaw
  • Loading branch information
temi committed May 19, 2024
1 parent 59fa0ba commit 2c69988
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class SpeciesReMatchService {

Map searchByName (String name, boolean addDetails = false, boolean useVernacularSearch = false ) {
Map result
if (useVernacularSearch)
if (!useVernacularSearch)
result = searchNameMatchingServer(name)
else
result = searchByVernacularNameOnNameMatchingServer(name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class SpeciesReMatchServiceSpec extends Specification implements ServiceUnitTest
"noIssue"
]
]
service.webService.getJson(_) >> resp
service.webService.getJson({it.contains("search?q=")}) >> resp
when:
def result = service.searchByName("name")

Expand All @@ -109,7 +109,7 @@ class SpeciesReMatchServiceSpec extends Specification implements ServiceUnitTest
def result2 = service.searchByName("name")

then:
service.webService.getJson(_) >> resp
service.webService.getJson({it.contains("search?q=")}) >> resp
result2 == [
scientificName: "Red",
commonName: null,
Expand All @@ -122,7 +122,7 @@ class SpeciesReMatchServiceSpec extends Specification implements ServiceUnitTest
def result3 = service.searchByName("name", false, true)

then:
service.webService.getJson(_) >> resp
service.webService.getJson({it.contains("searchByVernacularName")}) >> resp
result3 == [
scientificName: "Red",
commonName: null,
Expand Down

0 comments on commit 2c69988

Please sign in to comment.