This commit is contained in:
Jorge Manrubia
2025-04-10 13:15:29 +02:00
parent e21bb99167
commit 468bbf1388
2 changed files with 17 additions and 0 deletions
+1
View File
@@ -27,6 +27,7 @@ text:
created_at: <%= 1.week.ago %>
status: published
last_active_at: <%= Time.current %>
stage: qa_in_progress
shipping:
collection: writebook
+16
View File
@@ -0,0 +1,16 @@
require "test_helper"
class Card::ColoredTest < ActiveSupport::TestCase
test "use default color no stage" do
assert_equal Colorable::DEFAULT_COLOR, cards(:logo).color
end
test "use default color not in doing stage" do
assert_equal Colorable::DEFAULT_COLOR, cards(:text).color
end
test "infer color from stage when in doing stage" do
cards(:text).engage
assert_equal cards(:text).stage.color, cards(:text).color
end
end