Add order field to widget cards

We will use this field to enter the position where the cards will be shown to the
user in the homepage.
This commit is contained in:
taitus
2023-10-10 08:33:03 +02:00
parent e9a7731f49
commit 9dd10cac19
4 changed files with 17 additions and 0 deletions

View File

@@ -18,6 +18,16 @@ describe Widget::Card do
expect(build(:widget_card, title: "")).not_to be_valid
end
describe "order" do
it "is not valid without an order" do
expect(build(:widget_card, order: nil)).not_to be_valid
end
it "is not valid with an order less than 1" do
expect(build(:widget_card, order: 0)).not_to be_valid
end
end
context "regular cards" do
it "is not valid without a link_url" do
card = build(:widget_card, header: false, link_url: nil)