0
다음 코드 :RSpec이 동일한 유형의 유효성 검사 오류를 여러 번보고하는 이유는 무엇입니까?
describe Task do
let(:task) { Task.new }
subject { task }
before(:each) do
task.valid?
p task.errors.full_messages
end
it { should have(1).error_on(:title) }
it { should have(1).error_on(:description) }
end
출력 : ["Title can't be blank", "Title can't be blank", "Title can't be blank"]
내가 이럴 줄 구체적인 이유를 알아낼 수 없습니다하지만 난 일을 경험하는 방식이 그하자 피사체가
심지어 다음 코드는 같은 오류를 생산하고이 문제의
it "should have 1 error on title" do
Task.new.should have(1).error_on(:title)
end
it "should have 1 error on description" do
Task.new.should have(1).error_on(:description)
end