examples/repo_and_user.rb in archivesspace-client-0.2.0 vs examples/repo_and_user.rb in archivesspace-client-0.3.0
- old
+ new
@@ -32,11 +32,11 @@
name: "Lionel Messi",
is_admin: true
}
user_password = "123456"
-repository = ArchivesSpace::Template.process(:repository_with_agent, repo_data)
+repository = ArchivesSpace::Template.process("repository_with_agent.json.erb", repo_data)
begin
response = client.post("/repositories/with_agent", repository)
if response.result.success?
repository = client.repositories.find { |r| r["repo_code"] == "XYZ" }
@@ -44,10 +44,10 @@
ap client.delete(repository["uri"])
else
ap response.parsed
end
- user = ArchivesSpace::Template.process(:user, user_data)
+ user = ArchivesSpace::Template.process("user.json.erb", user_data)
response = client.post("users", user, {password: user_password})
if response.result.success?
user = client.users.find { |r| r["username"] == "lmessi" }
ap user
ap client.delete user["uri"]