fp/services/bright/test/bright/vtubers_test.exs

162 lines
7.8 KiB
Elixir

defmodule Bright.VtubersTest do
use Bright.DataCase
alias Bright.Vtubers
describe "vtubers" do
alias Bright.Vtubers.Vtuber
import Bright.VtubersFixtures
@invalid_attrs %{image: nil, slug: nil, display_name: nil, chaturbate: nil, twitter: nil, patreon: nil, twitch: nil, tiktok: nil, onlyfans: nil, youtube: nil, linktree: nil, carrd: nil, fansly: nil, pornhub: nil, discord: nil, reddit: nil, throne: nil, instagram: nil, facebook: nil, merch: nil, description_1: nil, description_2: nil, theme_color: nil, fansly_id: nil, chaturbate_id: nil, twitter_id: nil}
test "list_vtubers/0 returns all vtubers" do
vtuber = vtuber_fixture()
assert Vtubers.list_vtubers() == [vtuber]
end
test "get_vtuber!/1 returns the vtuber with given id" do
vtuber = vtuber_fixture()
assert Vtubers.get_vtuber!(vtuber.id) == vtuber
end
test "create_vtuber/1 with valid data creates a vtuber" do
valid_attrs = %{image: "some image", slug: "some slug", display_name: "some display_name", chaturbate: "some chaturbate", twitter: "some twitter", patreon: "some patreon", twitch: "some twitch", tiktok: "some tiktok", onlyfans: "some onlyfans", youtube: "some youtube", linktree: "some linktree", carrd: "some carrd", fansly: "some fansly", pornhub: "some pornhub", discord: "some discord", reddit: "some reddit", throne: "some throne", instagram: "some instagram", facebook: "some facebook", merch: "some merch", description_1: "some description_1", description_2: "some description_2", theme_color: "some theme_color", fansly_id: "some fansly_id", chaturbate_id: "some chaturbate_id", twitter_id: "some twitter_id"}
assert {:ok, %Vtuber{} = vtuber} = Vtubers.create_vtuber(valid_attrs)
assert vtuber.image == "some image"
assert vtuber.slug == "some slug"
assert vtuber.display_name == "some display_name"
assert vtuber.chaturbate == "some chaturbate"
assert vtuber.twitter == "some twitter"
assert vtuber.patreon == "some patreon"
assert vtuber.twitch == "some twitch"
assert vtuber.tiktok == "some tiktok"
assert vtuber.onlyfans == "some onlyfans"
assert vtuber.youtube == "some youtube"
assert vtuber.linktree == "some linktree"
assert vtuber.carrd == "some carrd"
assert vtuber.fansly == "some fansly"
assert vtuber.pornhub == "some pornhub"
assert vtuber.discord == "some discord"
assert vtuber.reddit == "some reddit"
assert vtuber.throne == "some throne"
assert vtuber.instagram == "some instagram"
assert vtuber.facebook == "some facebook"
assert vtuber.merch == "some merch"
assert vtuber.description_1 == "some description_1"
assert vtuber.description_2 == "some description_2"
assert vtuber.theme_color == "some theme_color"
assert vtuber.fansly_id == "some fansly_id"
assert vtuber.chaturbate_id == "some chaturbate_id"
assert vtuber.twitter_id == "some twitter_id"
end
test "create_vtuber/1 with invalid data returns error changeset" do
assert {:error, %Ecto.Changeset{}} = Vtubers.create_vtuber(@invalid_attrs)
end
test "update_vtuber/2 with valid data updates the vtuber" do
vtuber = vtuber_fixture()
update_attrs = %{image: "some updated image", slug: "some updated slug", display_name: "some updated display_name", chaturbate: "some updated chaturbate", twitter: "some updated twitter", patreon: "some updated patreon", twitch: "some updated twitch", tiktok: "some updated tiktok", onlyfans: "some updated onlyfans", youtube: "some updated youtube", linktree: "some updated linktree", carrd: "some updated carrd", fansly: "some updated fansly", pornhub: "some updated pornhub", discord: "some updated discord", reddit: "some updated reddit", throne: "some updated throne", instagram: "some updated instagram", facebook: "some updated facebook", merch: "some updated merch", description_1: "some updated description_1", description_2: "some updated description_2", theme_color: "some updated theme_color", fansly_id: "some updated fansly_id", chaturbate_id: "some updated chaturbate_id", twitter_id: "some updated twitter_id"}
assert {:ok, %Vtuber{} = vtuber} = Vtubers.update_vtuber(vtuber, update_attrs)
assert vtuber.image == "some updated image"
assert vtuber.slug == "some updated slug"
assert vtuber.display_name == "some updated display_name"
assert vtuber.chaturbate == "some updated chaturbate"
assert vtuber.twitter == "some updated twitter"
assert vtuber.patreon == "some updated patreon"
assert vtuber.twitch == "some updated twitch"
assert vtuber.tiktok == "some updated tiktok"
assert vtuber.onlyfans == "some updated onlyfans"
assert vtuber.youtube == "some updated youtube"
assert vtuber.linktree == "some updated linktree"
assert vtuber.carrd == "some updated carrd"
assert vtuber.fansly == "some updated fansly"
assert vtuber.pornhub == "some updated pornhub"
assert vtuber.discord == "some updated discord"
assert vtuber.reddit == "some updated reddit"
assert vtuber.throne == "some updated throne"
assert vtuber.instagram == "some updated instagram"
assert vtuber.facebook == "some updated facebook"
assert vtuber.merch == "some updated merch"
assert vtuber.description_1 == "some updated description_1"
assert vtuber.description_2 == "some updated description_2"
assert vtuber.theme_color == "some updated theme_color"
assert vtuber.fansly_id == "some updated fansly_id"
assert vtuber.chaturbate_id == "some updated chaturbate_id"
assert vtuber.twitter_id == "some updated twitter_id"
end
test "update_vtuber/2 with invalid data returns error changeset" do
vtuber = vtuber_fixture()
assert {:error, %Ecto.Changeset{}} = Vtubers.update_vtuber(vtuber, @invalid_attrs)
assert vtuber == Vtubers.get_vtuber!(vtuber.id)
end
test "delete_vtuber/1 deletes the vtuber" do
vtuber = vtuber_fixture()
assert {:ok, %Vtuber{}} = Vtubers.delete_vtuber(vtuber)
assert_raise Ecto.NoResultsError, fn -> Vtubers.get_vtuber!(vtuber.id) end
end
test "change_vtuber/1 returns a vtuber changeset" do
vtuber = vtuber_fixture()
assert %Ecto.Changeset{} = Vtubers.change_vtuber(vtuber)
end
end
describe "vtubers" do
alias Bright.Vtubers.Vtuber
import Bright.VtubersFixtures
@invalid_attrs %{}
test "list_vtubers/0 returns all vtubers" do
vtuber = vtuber_fixture()
assert Vtubers.list_vtubers() == [vtuber]
end
test "get_vtuber!/1 returns the vtuber with given id" do
vtuber = vtuber_fixture()
assert Vtubers.get_vtuber!(vtuber.id) == vtuber
end
test "create_vtuber/1 with valid data creates a vtuber" do
valid_attrs = %{}
assert {:ok, %Vtuber{} = vtuber} = Vtubers.create_vtuber(valid_attrs)
end
test "create_vtuber/1 with invalid data returns error changeset" do
assert {:error, %Ecto.Changeset{}} = Vtubers.create_vtuber(@invalid_attrs)
end
test "update_vtuber/2 with valid data updates the vtuber" do
vtuber = vtuber_fixture()
update_attrs = %{}
assert {:ok, %Vtuber{} = vtuber} = Vtubers.update_vtuber(vtuber, update_attrs)
end
test "update_vtuber/2 with invalid data returns error changeset" do
vtuber = vtuber_fixture()
assert {:error, %Ecto.Changeset{}} = Vtubers.update_vtuber(vtuber, @invalid_attrs)
assert vtuber == Vtubers.get_vtuber!(vtuber.id)
end
test "delete_vtuber/1 deletes the vtuber" do
vtuber = vtuber_fixture()
assert {:ok, %Vtuber{}} = Vtubers.delete_vtuber(vtuber)
assert_raise Ecto.NoResultsError, fn -> Vtubers.get_vtuber!(vtuber.id) end
end
test "change_vtuber/1 returns a vtuber changeset" do
vtuber = vtuber_fixture()
assert %Ecto.Changeset{} = Vtubers.change_vtuber(vtuber)
end
end
end