diff --git a/db/migrate/20190924190539_rename_device_last_ota_checkto_last_ota_checkup.rb b/db/migrate/20190924190539_rename_device_last_ota_checkto_last_ota_checkup.rb new file mode 100644 index 000000000..7e85ad772 --- /dev/null +++ b/db/migrate/20190924190539_rename_device_last_ota_checkto_last_ota_checkup.rb @@ -0,0 +1,7 @@ +class RenameDeviceLastOtaChecktoLastOtaCheckup < ActiveRecord::Migration[5.2] + safety_assured + + def change + rename_column :devices, :last_ota_check, :last_ota_checkup + end +end diff --git a/db/structure.sql b/db/structure.sql index e22d6f68d..683567302 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -277,7 +277,7 @@ CREATE TABLE public.devices ( serial_number character varying(32), mqtt_rate_limit_email_sent_at timestamp without time zone, last_ota timestamp without time zone, - last_ota_check timestamp without time zone + last_ota_checkup timestamp without time zone ); @@ -3274,6 +3274,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20190804194135'), ('20190804194154'), ('20190823164837'), -('20190918185359'); +('20190918185359'), +('20190924190539'); diff --git a/package.json b/package.json index 4668b0cdf..b2c5b80ec 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "coveralls": "3.0.6", "enzyme": "3.10.0", "enzyme-adapter-react-16": "1.14.0", - "farmbot": "8.3.0-rc0", + "farmbot": "8.3.0-rc1", "i18next": "17.0.16", "lodash": "4.17.15", "markdown-it": "10.0.0", diff --git a/spec/lib/celery_script/corpus_spec.rb b/spec/lib/celery_script/corpus_spec.rb index 0c1f9207c..817e25fa5 100644 --- a/spec/lib/celery_script/corpus_spec.rb +++ b/spec/lib/celery_script/corpus_spec.rb @@ -230,4 +230,30 @@ describe CeleryScript::Corpus do expect(check.valid?).to be_falsey expect(check.error.message).to include("cannot exceed 3 minutes") end + + it "allows valid `point_group` nodes" do + device.auto_sync_transaction do + pg = PointGroups::Create.run!(device: device, + name: "cs checks", + point_ids: []) + bad = CeleryScript::AstNode.new({ + kind: "point_group", + args: { resource_id: pg.id }, + }) + check = CeleryScript::Checker.new(bad, corpus, device) + expect(check.valid?).to be true + end + end + + it "disallows invalid `point_group` nodes" do + device.auto_sync_transaction do + bad = CeleryScript::AstNode.new({ + kind: "point_group", + args: { resource_id: -1 }, + }) + check = CeleryScript::Checker.new(bad, corpus, device) + expect(check.valid?).to be false + expect(check.error.message).to eq("Can't find PointGroup with id of -1") + end + end end