16 lines
315 B
Ruby
16 lines
315 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe Park, type: :model do
|
|
describe "#alerts" do
|
|
it "has alerts" do
|
|
expect(parks(:one).alerts).to eq([alerts(:one)])
|
|
end
|
|
|
|
it "destroys dependent alerts" do
|
|
expect do
|
|
parks(:one).destroy!
|
|
end.to change(Alert, :count).by(-1)
|
|
end
|
|
end
|
|
end
|