def can_save(board,role)
if ar_user = already_registered?(email) || user = self.save
Participant.make(ar_user||user, board, role)
end
user
end
I do this rspec test on it:
it "should return the user if the user is not already registered" do
lambda do
user = @new_user.can_save(@board, "Manager")
end.should change(User,:count).by(1)
end
我发现这一错误:
undefined method `id for true:TrueClass
为什么如此?