I have an oddly specific problem. Let's say I have this table in a Rails project:
create_table "documents", force: true do |t|
t.text "tags"
end
add_index "documents", ["tags"], name: "index_documents_on_tags", type: :fulltext
I have an integration test that creates a few Document
instances with varying tag combinations, which the method I'm trying to test should return by way of a fulltext search. Unfortunately, it turns out that InnoDB doesn't rebuild its fulltext indices until the current transaction ends, meaning that my search comes up empty.
If I build the test data in fixtures (e.g. in advance, outside of the transaction that rspec uses for each test) it all works fine, but is there any way for me to tweak the data and run a search against it within the same test?