On Dec 17, 2007 2:13 PM, Jeroen Houben <[EMAIL PROTECTED]> wrote: > Hi, > > I just moved from 1.08 to 1.10 and now have one example failing, which, > under 1.08, passed. Is the due to a change in behaviour? > > Here's my spec (removed some passing examples) > > require File.dirname(__FILE__) + '/../spec_helper' > > describe "A user" do > > before(:each) do > @user = User.new > @valid_user = User.new( > :email => '[EMAIL PROTECTED]', > :fname => 'bert', > :lname => 'valid', > :jobtitle => "programmer" > ) > end > > it "should have a unique email address" do > @valid_user.save.should == true > @user.email = @valid_user.email > @user.should have(1).error_on(:email) > end > > it "should allow two users with the same name" do > @valid_user.save.should == true > @user.fname = @valid_user.fname > @user.lname = @valid_user.lname > @user.should have(:no).error_on(:fname) > @user.should have(:no).error_on(:lname) > end > > end > > The second example now fails, as the inserted record from the first example > is not rolled back. >
I don't see a fixtures :users in your spec. Do you have this in your spec_helper? Have you rerun script/generate rspec after you upgraded? There are some changes in the spec_helper.rb file between the two releases. Aslak > I can just put a User.delete_all in an after(:each) block but I think it > would be nicer if Rspec wrapped each example in a db transaction. Wasn't > this they way things worked in 1.08 ? > > Jeroen > > _______________________________________________ > rspec-users mailing list > [email protected] > http://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
