Tôi đang cố gắng gặp lỗi trong thử nghiệm rspec
.Lỗi mong đợi trong các thử nghiệm rspec
lambda {Participant.create!({:user_id => three.id, :match_id => match.id, :team => 1})}.should raise_error StandardError
Hiện tại tôi chỉ đang sử dụng StandardError
để đảm bảo nó hoạt động.
1) StandardError in 'Participant should never allow more participants than players'.
This game is already full. Cannot add another player.
/home/josiah/Projects/Set-Match/app/models/participant.rb:12:in `do_not_exceed_player_count_in_match'
./spec/models/participant_spec.rb:24:
Nó rõ ràng đã ném lỗi, nhưng thử nghiệm của tôi vẫn không thành công.
Suy nghĩ?
Thanks for the tip. –