Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resque_spec apparently not queuing anything in cucumber #16

Open
ngw opened this issue Jun 6, 2011 · 2 comments
Open

resque_spec apparently not queuing anything in cucumber #16

ngw opened this issue Jun 6, 2011 · 2 comments

Comments

@ngw
Copy link

ngw commented Jun 6, 2011

Very weird problem ...

I have something working in production mode (manually testing exactly the same steps) and not working in my features, because Resque basically doesn't enqueue jobs (Resque.size is always 0).

The method that enqueues jobs is:

def generate!
begin
Resque.enqueue( PortfolioGenerator, id.to_s )
Rails.logger.info "\n\n#{ Resque.size( 'portfolio_generator' ) }\n\n"
rescue => e
Rails.logger.info "\n#{e}\n"
end
end

I'm 100% sure that it gets called by cucumber (I see the output, always 0).

Here are the steps:

Before '@Queue' do
ResqueSpec.reset!
end

When /^I upload my portfolio$/ do
fill_in "portfolio[title]", :with => "Title"
fill_in "portfolio[tagline]", :with => "Tagline"
fill_in "portfolio[introduction]", :with => "Introduction"
attach_file "portfolio[project]", File.join( Rails.root, 'spec', 'fixtures', 'fake_zip.zip' )
end

Then /^I should have enqueued a portfolio generation$/ do
PortfolioGenerator.should have_queued( User.last.portfolio.id )
end

And the feature is:

Scenario: Enqueue a portfolio for generation
Given I am an existing user
When I follow "Generate your portfolio"
And I upload my portfolio
And I press "Preview"
Then I should have enqueued a portfolio generation

It fails with RSpec::Expectations::ExpectationNotMetError

This is my bundle: https://gist.github.com/c91eeea75ad3f714cba1

Do you have any idea on why this happens?

@leshill
Copy link
Owner

leshill commented Jun 7, 2011

Hi,

Nothing is jumping out at me. Try this:

Add a debugger statement after line #23 in lib/resque_spec/ext.rb
When you run your scenario, you should hit that debugger and then walk through to see what is happening.

@leshill
Copy link
Owner

leshill commented Jan 9, 2012

Hi,

Was this resolved for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants