Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

fs_create_authors doesn't work #78

Closed
cboettig opened this issue Mar 21, 2014 · 1 comment
Closed

fs_create_authors doesn't work #78

cboettig opened this issue Mar 21, 2014 · 1 comment
Labels
Milestone

Comments

@cboettig
Copy link
Collaborator

also means we cannot use fs_create or fs_new_article with an undefined author.

@cboettig cboettig added this to the v0.3 milestone Mar 21, 2014
@cboettig cboettig added the bug label Mar 21, 2014
@cboettig
Copy link
Collaborator Author

  # We need a unique name...
  library(uuid)
  full_name = paste("John", UUIDgenerate())

  author_id <- fs_create_author(full_name)
  expect_is(author_id, "numeric")

  # If we try to create the same author, 
  expect_warning(id <- fs_create_author(full_name))
 # expect to get back the original id  ## NOT implemented in the figshare API yet! Emailed Mark 
 # expect_equal(id, author_id)

  MrX <- paste("John", UUIDgenerate())
  id <- fs_new_article(title="title", description="description", 
                 authors = c("Karthik Ram", MrX))
  d <- fs_details(id)

  # Expect that Mr X is now the third author
  expect_match(sapply(d$authors, `[[`, "last_name")[[3]], strsplit(MrX, ' ')[[1]][2])

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant