Added `sprouted` plant stage. NEXT: Update CeleryScript things.

pull/1009/head
Rick Carlino 2018-10-14 17:11:19 -05:00
parent 51d927b9b5
commit f666361ddb
2 changed files with 11 additions and 7 deletions

View File

@ -17,7 +17,7 @@ module CeleryScriptSettingsBag
# List of all celery script nodes that can be used as a varaible...
ANY_VARIABLE = [:tool, :coordinate, :point, :identifier]
PLANT_STAGES = %w(planned planted harvested)
PLANT_STAGES = %w(planned planted harvested sprouted)
ALLOWED_PIN_MODES = [DIGITAL = 0, ANALOG = 1]
ALLOWED_RPC_NODES = %w(home emergency_lock emergency_unlock read_status
sync check_updates power_off reboot toggle_pin

View File

@ -26,16 +26,20 @@ describe Api::PointsController do
time = (DateTime.now - 1.day).to_json
p = { x: 23,
y: 45,
name: "My Lettuce",
name: "Put me in a salad",
pointer_type: "Plant",
openfarm_slug: "limestone-lettuce",
planted_at: time }
openfarm_slug: "mung-bean",
planted_at: time,
plant_stage: "sprouted"
}
post :create, body: p.to_json, params: { format: :json }
expect(response.status).to eq(200)
plant = Plant.last
expect(plant.x).to eq(p[:x])
expect(plant.y).to eq(p[:y])
expect(plant.name).to eq(p[:name])
expect(plant.x).to eq(p[:x])
expect(plant.y).to eq(p[:y])
expect(plant.name).to eq(p[:name])
expect(plant.plant_stage).to eq("sprouted")
expect(p[:plant_stage]).to eq("sprouted")
expect(plant.openfarm_slug).to eq(p[:openfarm_slug])
expect(plant.created_at).to be_truthy
p.keys.each do |key|