Test coverage up
parent
7a81fc963d
commit
bccce6755b
|
@ -44,5 +44,17 @@ describe Api::PointsController do
|
|||
expect(json.first[:id]).to eq(ts.id)
|
||||
expect(json.first[:name]).to eq(ts.name)
|
||||
end
|
||||
|
||||
it "handles outdated FBOS" do
|
||||
old_last_seen = user.device.last_seen
|
||||
ua = "FARMBOTOS/1.1.1 (RPI3) RPI3 (1.1.1)"
|
||||
allow(request).to receive(:user_agent).and_return(ua)
|
||||
request.env["HTTP_USER_AGENT"] = ua
|
||||
sign_in user
|
||||
FactoryGirl.create_list(:point, 1, device: device)
|
||||
get :index
|
||||
expect(response.status).to eq(426)
|
||||
expect(json[:error]).to include("Upgrade to latest FarmBot OS")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue