From c19a6eec2b5267d537548a093f912b27edc38545 Mon Sep 17 00:00:00 2001 From: otsuki-at Date: Mon, 25 Aug 2025 14:38:08 +0900 Subject: [PATCH] Update task detail screen to display state --- app/views/tasks/show.html.erb | 5 +++++ test/models/task_test.rb | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/app/views/tasks/show.html.erb b/app/views/tasks/show.html.erb index ea0263a1..ef93cef5 100644 --- a/app/views/tasks/show.html.erb +++ b/app/views/tasks/show.html.erb @@ -18,6 +18,11 @@ <% end %> +
+

状態

+ <%= @task.state.name %> +
+

説明

diff --git a/test/models/task_test.rb b/test/models/task_test.rb index 91fb3e8e..e873306f 100644 --- a/test/models/task_test.rb +++ b/test/models/task_test.rb @@ -30,6 +30,12 @@ def setup assert_not Task.new(task).save end + test "should not create task without task_state_id" do + task = @task_template.clone + task[:task_state_id] = nil + assert_not Task.new(task).save + end + test "should delete task" do task = @task_template.clone task = Task.create(task)