Skip to content

Commit

Permalink
Ref ixpantia#22 checks on warnings and error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnyhdez committed Apr 9, 2020
1 parent 7138e24 commit c837f9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion R/search_contacts.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ search_contacts <- function(user_code, api_token, search_term = "") {
warning("Please add a valid user code")
} else if (missing(api_token)) {
warning("Please add a valid API token")
} else
} else {
tryCatch(
{
r <- get_request(user_code = user_code,
Expand Down Expand Up @@ -95,6 +95,7 @@ search_contacts <- function(user_code, api_token, search_term = "") {
select(-result_email, -result_phone, -result_website, -result_address,
-result_contact_custom_fields, -result_custom_fields)
return(contenido)
}

}

2 changes: 1 addition & 1 deletion tests/testthat/test-credentials.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ testthat::test_that("Contact information error message with invalid credentials"
contact_id = "Fulano"))
})

testthat::test_that("Contact information error message with invalid credentials", {
testthat::test_that("Search contacts error message with invalid credentials", {
expect_error(search_contacts(user_code = "6A6E88",
api_token = "TQ9XM",
search_term = "brenesii"))
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-error-warning-msg.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ testthat::test_that("Invalid credentials", {
)

expect_warning(
get_pipeline_report(user_code = "6A6E88",
api_token = "96066"),
"Please add a valid pipeline ID"
search_contacts(user_code = "6A6E88",
search_term = "ixpantia"),
"Please add a valid API token"
)
})

Expand Down

0 comments on commit c837f9f

Please sign in to comment.