mirror of
https://github.com/usetrmnl/terminus.git
synced 2026-08-13 14:29:27 -07:00
Added extension factory safe defaults
Necessary to provide safe defaults which match the database schema for less setup across the specs. This change also required updating some affected specs since the new defaults caused a slight change in behavior. Milestone: patch
This commit is contained in:
@@ -17,7 +17,7 @@ RSpec.describe Terminus::Aspects::Jobs::Schedule do
|
||||
|
||||
expect(sidekiq.get_all_schedules).to eq(
|
||||
"extension-test" => {
|
||||
"cron" => "* * * * * UTC",
|
||||
"cron" => "*/1 * * * * UTC",
|
||||
"class" => "Terminus::Jobs::Batches::Extension",
|
||||
"args" => [1],
|
||||
"description" => "The Test extension update schedule."
|
||||
|
||||
@@ -22,14 +22,14 @@ RSpec.describe Terminus::Structs::Extension do
|
||||
label: "Test",
|
||||
description: nil,
|
||||
kind: "poll",
|
||||
mode: nil,
|
||||
tags: nil,
|
||||
mode: "text",
|
||||
tags: [],
|
||||
static_body: nil,
|
||||
fields: [],
|
||||
data: {},
|
||||
days: nil,
|
||||
days: [],
|
||||
interval: 5,
|
||||
last_day_of_month: nil,
|
||||
last_day_of_month: false,
|
||||
start_at: "2025-01-02T03:04:05+00:00",
|
||||
unit: "minute"
|
||||
)
|
||||
|
||||
@@ -45,11 +45,11 @@ RSpec.describe Terminus::Views::Parts::Extension do
|
||||
end
|
||||
|
||||
it "answers empty array string when empty" do
|
||||
allow(extension).to receive(:days).and_return([])
|
||||
expect(part.formatted_days).to eq("")
|
||||
end
|
||||
|
||||
it "answers empty array string when nil" do
|
||||
allow(extension).to receive(:days).and_return(nil)
|
||||
expect(part.formatted_days).to eq("")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -35,7 +35,7 @@ RSpec.describe "Extension Exchanges", :db do
|
||||
exchange
|
||||
visit routes.path(:extension_exchanges, extension_id: extension.id)
|
||||
|
||||
within "td.bit-actions", text: extension.template do
|
||||
within "td.bit-actions" do
|
||||
accept_prompt { click_button "Delete" }
|
||||
end
|
||||
|
||||
|
||||
@@ -3,11 +3,17 @@
|
||||
Factory.define :extension, relation: :extension do |factory|
|
||||
factory.sequence(:name) { "extension_#{it}" }
|
||||
factory.sequence(:label) { "Extension #{it}" }
|
||||
factory.mode "text"
|
||||
factory.kind "poll"
|
||||
factory.tags []
|
||||
factory.template "<h1>{{source_1.label}}</h1>"
|
||||
factory.data Hash.new
|
||||
factory.fields []
|
||||
factory.start_at Time.utc(2025, 1, 1, 0, 0, 0)
|
||||
factory.interval 1
|
||||
factory.unit "none"
|
||||
factory.days []
|
||||
factory.last_day_of_month false
|
||||
|
||||
factory.trait :with_logo do |trait|
|
||||
trait.logo_data do
|
||||
|
||||
Reference in New Issue
Block a user