Nick Hoffman wrote: > To spec your #activate! , why not do something like this?: > > it 'should activate the user' do > @user.active.should be_false > @user.activate! > @user.active.should be_true > end > >
Thanks for your reply Hoffman :) I did the same but it gives error like "#23000Duplicate entry 'kk...@gmail.com Insert INTO (...) Values(...)". It should do update not Insert. But when i try call it with a new instance of user (with no values assigned to any user attribute) then it works. i.e. it "should activate the user" do @user1=User.new @user1.activate! end This works. I think i have to erase all the User attributes from "before (:each)" and only assigned it in Examples which required it. am i right ? Thanks -- Posted via http://www.ruby-forum.com/. _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users