Skip to content

Commit

Permalink
Ref ixpantia#22 verification of conditionals in functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnyhdez committed Apr 9, 2020
1 parent f9c6444 commit 42d84ab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ URL: https://ixpantia.github.io/lacrmr/
BugReports: https://github.com/ixpantia/lacrmr/issues
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.0.2
RoxygenNote: 7.1.0
Depends:
R (>= 3.6),
magrittr
Expand Down
5 changes: 4 additions & 1 deletion R/get_contact_information.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ get_contact_information <- function(user_code, api_token, contact_id = "") {
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 @@ -45,6 +47,7 @@ get_contact_information <- function(user_code, api_token, contact_id = "") {
janitor::clean_names()

return(contenido)
}

}

7 changes: 7 additions & 0 deletions tests/testthat/test-error-warning-msg.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ testthat::test_that("Invalid credentials", {
"Invalid user credentials. Please check your user code or your api token"
)

expect_warning(
get_contact_information(user_code = "6A6E88",
api_token = "96066",
contact_id = "h5jkfgns7"),
"Please add a valid pipeline ID"
)

expect_warning(
get_pipeline_report(user_code = "6A6E88",
api_token = "96066"),
Expand Down

0 comments on commit 42d84ab

Please sign in to comment.