Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5845493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:26:33+00:00 2026-05-22T12:26:33+00:00

I want to test some features that needs delayed jobs to work, on cucumber.

  • 0

I want to test some features that needs delayed jobs to work, on cucumber. I have defined the following step:

Given /^jobs are being dispatched$/ do 
    Delayed::Worker.new.work_off
end

Right now, I am trying to test email notifications. So I have the following scenario:

Scenario: Receiving email when signing up   
      Given I am on the signup page
      And I fill in "user[email]" with "test@test.com" 
      And I fill in "user[password]" with "password"
      And I fill in "user[password_confirmation]" with "password"
      And I press "Sign up"
      Then I should be on the homepage
      Given jobs are being dispatched
      Then "test@test.com" should receive 1 emails

The should receive n emails step is defined by email_spec and is defined as:

Then /^(?:I|they|"([^"]*?)") should receive (an|no|\d+) emails?$/ do |address, amount|
  unread_emails_for(address).size.should == parse_email_count(amount)
end

So the test fails telling me that I am receiving 0 emails (the test@test.com is replaced by a real email in this test and I am not receiving anything). I suspect that the worker didn’t really start. What should I check? By the way, when I test in development mode I really receive that email.

Thanks

Edit:

It looks like I am getting a SQLite3::BusyException:

SQLite3::BusyException: database is locked: INSERT INTO “delayed_jobs” ….

Now to investigate why and how I can get rid of that! Any idea? (besides moving my database to PostgreSQL or mySQL).

Edit:
Ok, I moved to PostgreSQL from SQLite, the records are being inserted into Delayed::Job but the email tests fail.

The config/environments/test.rb file contains:

 config.action_mailer.delivery_method = :test
  config.action_mailer.perform_deliveries = true

  config.action_mailer.smtp_settings = {
     :address              => "smtp.gmail.com",
     :port                 => 587,
     :domain               => "mydomain.com",
     :user_name            => "name@mydomain.com",
     :password             => "mypassword",
     :authentication       => "plain",
     :enable_starttls_auto => true
   }

  config.action_mailer.default_url_options = { :host => 'localhost:3000' } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:26:34+00:00Added an answer on May 22, 2026 at 12:26 pm

    Sorry, but the answer is to move off of sqlite. Delayed job locks the database so your app gets staved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some kind of test data and want to create a unit test
I want to test some PHP on my local machine running Windows XP Professional.
Writing some test scripts in IronPython, I want to verify whether a window is
I need to test some charting classes. For these I want to create a
I don't see why this doesn't work. I assume that for some really lame
I develop some features based on Eclispe GEF. I want to create a label
i want to perform some test by using Json . I am using google
I want to test which interfaces a class/interface is implementing. So I have a
We want test the JTAPI feature of our application. Are there any emulator for
I want to test the behavior of a certain piece of .NET code in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.