Hello,

I have an endpoint that uses a Sequel Model with full_text_search to pull 
the data and return.  This all works fine, but when I goto test it the test 
always fails because the data hasn't been committed to the DB yet.

I have this code in my spec_helper.rb file

config.around(:each) do |example|
  @app.database.transaction(:rollback=>:always, 
:auto_savepoint=>true){example.run}
end


which means, that when I run this test

it 'will return a specific record' do
  spec_deploy = create(:deploy, user_id: user[:id], build_id: build[:id])
  get "/rest/v1/deploy?q=#{spec_deploy[:author]}"
  expect(last_response.status).to eq(200)
  json = JSON.parse(last_response.body)
  expect(json['records']).not_to be_empty
end


It fails because it tries to run the full_text_search count query on the db 
and the data doesn't exist.

Is there a way for me to tell this specific test to not use transactions or 
to commit and rollback manually?

I'll be more than happy to provide more code or details if needed.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to