require "test_helper" class PageControllerTest < ActionDispatch::IntegrationTest test "home returns 200" do get root_path assert_response :success end test "busca returns 200 with empty query" do get "/search", params: { q: "" } assert_response :success end test "busca returns 200 with search term" do Informativo.create!(titulo: "Desmatamento na Amazônia") get "/search", params: { q: "Amazônia" } assert_response :success end test "informativo page returns 200 for valid id" do info = Informativo.create!(titulo: "Artigo de teste", markdown: "Conteúdo") get "/informativo/#{info.Idinformativo}" assert_response :success end test "tag page returns 200 for existing tag" do Tag.create!(nome: "biodiversidade") get "/tag/biodiversidade" assert_response :success end test "tema page returns 200 for existing tema" do Tema.create!(cod_tema: 5, tema: "Água", padrao: "Água", param: "agua", count: 0) get "/tema/agua" assert_response :success end end