[rspec-users] [Cucumber] Cucumber and acts_as_xapian

r_j_h_box-sf at yahoo.com r_j_h_box-sf at yahoo.com
Mon Feb 2 12:15:15 EST 2009

A question for edumacational purposes here: Instead of disabling transactions, would it be effective to include all the steps of inserting the record and running the search, inside one scenario?

Given [the record is added to the database"
When [I search for it]
Then [I should find it]

If this can't work, then something is confusing me.  I haven't gotten into integration testing yet, but I would like to be armed with some level of understanding going in.


----- Original Message ----
> From: Ben Mabey <ben at benmabey.com>
> To: rspec-users <rspec-users at rubyforge.org>
> Sent: Monday, February 2, 2009 8:00:14 AM
> Subject: Re: [rspec-users] [Cucumber] Cucumber and acts_as_xapian
> Bart Zonneveld wrote:
> > Hey list,
> > 
> > Anyone have experience with acts_as_xapian and Cucumber? I'm struggling with 
> updating xapian's index, to actually "find" fluff that has been indexed..
> > In a scenario, I'm adding a bunch of articles, and in the actual search step, 
> I run:
> > 
> > When "I search for \"$query\"" do |query|
> >   %x[rake RAILS_ENV=test xapian:update_index]
> >   fill_in "Search", :with => query
> >   click_button 'Search'
> > end
> > 
> > At this point in the scenario, I can see there are articles in the database. 
> But if I try to query the articles using xapian after the update_index rake task 
> has run, I don't see any results.
> > Could this have to do with transactional fixtures or something? Really stuck 
> here, because I obviously don't want to stub these searches, and I do want to 
> test them.
> Yeah, I would say this is due to the transactions.  Try disabling the 
> transactions and cleaning up the DB yourself (i.e. truncating all the tables) in 
> the Before hooks.
> -Ben
> > 
> > thanks,
> > bartz
> > _______________________________________________
> > rspec-users mailing list
> > rspec-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-users
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list