Topic: RSpec raise_error problem?
I'm running edge Rails and edge RSpec, so this might be caused by that. Or by my stupidity really, either way. But essentially, I'm trying to say that a call to an ActiveRecord object should raise_error(), but it's not working, and the test continuously fails, but with the error message that I'm trying to catch. Am I catching this wrong? Is it some problem in RSpec?
class User < ActiveRecord::Base
require File.dirname(__FILE__) + '/../spec_helper'
describe User, "as a recipient" do
@user = User.create
@event = Event.create
@gift = Gift.create
@user.hosting_event = @event
it "should not be able to select gifts for my event" do
@user.hosting_event.gifts << @gift
@user is not a member of attendees, so it should raise an error. And it does. But somehow the error flunks the test, rather than verifying it with .should raise_error.
Does anyone know what I'm doing wrong?