pull/1398/head
Rick Carlino 2019-08-27 10:20:13 -05:00
commit 77bb85bb67
2 changed files with 5 additions and 5 deletions

View File

@ -6,9 +6,9 @@ module Api
message: :to_s,
type: :to_s,
verbosity: :to_i,
x: :to_i,
y: :to_i,
z: :to_i,
x: :to_f,
y: :to_f,
z: :to_f,
}
def search

View File

@ -205,7 +205,7 @@ describe Api::LogsController do
it "filters logs based on criteria" do
sign_in user
Log.destroy_all
[-10, 0, 10, 20].map do |x|
[-10.0, 0, 10, 20].map do |x|
FactoryBot.create(:log,
device: user.device,
x: x,
@ -214,7 +214,7 @@ describe Api::LogsController do
get :search, params: { x: -10 }
expect(response.status).to eq(200)
expect(json.length).to eq(1)
expect(json.dig(0, :message)).to eq("This is -10")
expect(json.dig(0, :message)).to eq("This is -10.0")
end
end
end