Add new stat
This commit is contained in:
@@ -4,6 +4,7 @@ RSpec.describe "Api::V1::Stats", type: :request do
|
||||
describe "GET /stats" do
|
||||
it "returns summary stats" do
|
||||
alerts(:two).update!(park_code: parks(:one).code)
|
||||
parks_by_states(:two).update!(state: "OR")
|
||||
|
||||
get api_v1_stats_url
|
||||
|
||||
@@ -11,7 +12,11 @@ RSpec.describe "Api::V1::Stats", type: :request do
|
||||
expect(response.parsed_body).to match(
|
||||
park_count: 2,
|
||||
alert_count: 2,
|
||||
most_alerts: {
|
||||
state_with_most_parks: {
|
||||
state: "OR",
|
||||
park_count: 2
|
||||
},
|
||||
park_with_most_alerts: {
|
||||
park_code: "crla",
|
||||
alert_count: 2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user