aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/models/audio_file_api_test.exs7
-rw-r--r--web/models/audio_file_api.ex4
2 files changed, 8 insertions, 3 deletions
diff --git a/test/models/audio_file_api_test.exs b/test/models/audio_file_api_test.exs
index 028befa..2e15a2e 100644
--- a/test/models/audio_file_api_test.exs
+++ b/test/models/audio_file_api_test.exs
@@ -3,7 +3,12 @@ defmodule TheTranscriberBackend.AudioFileAPITest do
alias TheTranscriberBackend.AudioFileAPI
- @valid_attrs %{}
+ @valid_attrs %{
+ audio_path: "myfile.mp3",
+ audio_name: "MyFile",
+ audio_duration: "00:00"
+
+ }
@invalid_attrs %{}
test "changeset with valid attributes" do
diff --git a/web/models/audio_file_api.ex b/web/models/audio_file_api.ex
index 802d179..a66cdc4 100644
--- a/web/models/audio_file_api.ex
+++ b/web/models/audio_file_api.ex
@@ -17,7 +17,7 @@ defmodule TheTranscriberBackend.AudioFileAPI do
"""
def changeset(struct, params \\ %{}) do
struct
- |> cast(params, [])
- |> validate_required([])
+ |> cast(params, [:audio_path, :audio_name, :audio_duration])
+ |> validate_required([:audio_path, :audio_name, :audio_duration])
end
end