media tests

This commit is contained in:
Kieran Eglin 2024-02-01 21:14:51 -08:00
parent 5ec0c0646c
commit 83be9e67e1
No known key found for this signature in database
GPG key ID: 193984967FCF432D
2 changed files with 6 additions and 6 deletions

View file

@ -30,11 +30,11 @@ defmodule Pinchflat.MediaTest do
end end
describe "list_pending_media_items_for/1" do describe "list_pending_media_items_for/1" do
test "it returns pending media_items for a given channel" do test "it returns pending media_items for a given source" do
source = source_fixture() source = source_fixture()
media_item = media_item_fixture(%{channel_id: channel.id, media_filepath: nil}) media_item = media_item_fixture(%{source_id: source.id, media_filepath: nil})
assert Media.list_pending_media_items_for(channel) == [media_item] assert Media.list_pending_media_items_for(source) == [media_item]
end end
test "it does not return media_items with media_filepath" do test "it does not return media_items with media_filepath" do
@ -42,11 +42,11 @@ defmodule Pinchflat.MediaTest do
_media_item = _media_item =
media_item_fixture(%{ media_item_fixture(%{
channel_id: channel.id, source_id: source.id,
media_filepath: "/video/#{Faker.File.file_name(:video)}" media_filepath: "/video/#{Faker.File.file_name(:video)}"
}) })
assert Media.list_pending_media_items_for(channel) == [] assert Media.list_pending_media_items_for(source) == []
end end
end end

View file

@ -16,7 +16,7 @@ defmodule Pinchflat.MediaFixtures do
media_id: Faker.String.base64(12), media_id: Faker.String.base64(12),
title: Faker.Commerce.product_name(), title: Faker.Commerce.product_name(),
media_filepath: "/video/#{Faker.File.file_name(:video)}", media_filepath: "/video/#{Faker.File.file_name(:video)}",
channel_id: MediaSourceFixtures.source_fixture().id source_id: MediaSourceFixtures.source_fixture().id
}) })
|> Pinchflat.Media.create_media_item() |> Pinchflat.Media.create_media_item()