Add test
This commit is contained in:
Vendored
+1
@@ -27,6 +27,7 @@ text:
|
||||
created_at: <%= 1.week.ago %>
|
||||
status: published
|
||||
last_active_at: <%= Time.current %>
|
||||
stage: qa_in_progress
|
||||
|
||||
shipping:
|
||||
collection: writebook
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user