Update BookForm tests to update required AuthorRoles.
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -91,12 +91,13 @@ defmodule DecentralisedBookIndex.Metadata.Forms.BookFormTest do
|
||||
end
|
||||
|
||||
describe "update existing book via the form" do
|
||||
test "update name", %{user: user} do
|
||||
test "update title, desciption and roles", %{user: user} do
|
||||
book = generate(book())
|
||||
|
||||
valid_params = %{
|
||||
"title" => "Another Book",
|
||||
"description" => "A cool book"
|
||||
"description" => "A cool book",
|
||||
"author_roles" => author_roles()
|
||||
}
|
||||
|
||||
form =
|
||||
@@ -131,6 +132,7 @@ defmodule DecentralisedBookIndex.Metadata.Forms.BookFormTest do
|
||||
describe "validation" do
|
||||
property "the book form is valid if the page count > 0", %{user: user} do
|
||||
book = generate(book())
|
||||
author_roles = author_roles()
|
||||
|
||||
valid_count_generator =
|
||||
StreamData.integer()
|
||||
@@ -138,7 +140,8 @@ defmodule DecentralisedBookIndex.Metadata.Forms.BookFormTest do
|
||||
|
||||
check all(page_count <- valid_count_generator) do
|
||||
valid_params = %{
|
||||
"page_count" => page_count
|
||||
"page_count" => page_count,
|
||||
"author_roles" => author_roles
|
||||
}
|
||||
|
||||
form =
|
||||
|
||||
Reference in New Issue
Block a user