Improve spec expectations

This commit is contained in:
2025-10-07 22:32:20 -07:00
parent 36d462dcbc
commit 3c732654d5

View File

@@ -2,9 +2,19 @@ require 'rails_helper'
RSpec.describe "Api::V1::Parks", type: :request do RSpec.describe "Api::V1::Parks", type: :request do
describe "GET /index" do describe "GET /index" do
it "returns http success" do it "returns some parks" do
get "/api/v1/parks/index" get api_v1_parks_url
expect(response).to have_http_status(:success) expect(response).to have_http_status(:success)
expect(response.parsed_body).to include(
hash_including(
code: "crla", name: "Crater Lake National Park", states: "OR"
)
)
expect(response.parsed_body).to include(
hash_including(
code: "olym", name: "Olympic National Park", states: "WA"
)
)
end end
end end
end end