Mam prosty test:
it "is removed when associated board is deleted" do
link = FactoryGirl.create(:link)
link.board.destroy
expect(Link.find(link.id)).to raise_error ActiveRecord::RecordNotFound
end
To nie przechodzi bo :
[code]1) Link is removed when associated board is deleted
Failure/Error: expect(Link.find(link.id)).to raise_error ActiveRecord::RecordNotFound
ActiveRecord::RecordNotFound:
Couldn’t find Link with id=1
./spec/models/link_spec.rb:47:in `block (2 levels) in <top (required)>’[/code]
Oczekuję rzucenia ActiveRecord::RecordNotFound i wykrzacza się bo rzuciło ten błąd?
Będę wdzięczny za podpowiedź.