otwarchive-symphonyarchive/spec/controllers/autocomplete_controller_spec.rb
2026-03-11 22:22:11 +00:00

13 lines
401 B
Ruby

require "spec_helper"
describe AutocompleteController do
describe "tag" do
let!(:tag1) { create(:canonical_fandom, name: "Match") }
let!(:tag2) { create(:canonical_fandom, name: "Blargh") }
it "returns only matching tags" do
get :tag, params: { term: "Ma", format: :json }
expect(JSON.parse(response.body)).to eq([{ "id" => "Match", "name" => "Match" }])
end
end
end