fixes flaky spec

Maybe using `build` instead of `create` was confusing the spec
This commit is contained in:
rgarcia
2017-09-15 15:55:35 +02:00
parent eb89d92320
commit 0de87c19c6

View File

@@ -1,6 +1,6 @@
require 'rails_helper'
RSpec.describe Geozone, type: :model do
describe Geozone do
let(:geozone) { build(:geozone) }
it "should be valid" do
@@ -13,6 +13,8 @@ RSpec.describe Geozone, type: :model do
end
describe "#safe_to_destroy?" do
let(:geozone) { create(:geozone) }
it "is true when not linked to other models" do
expect(geozone.safe_to_destroy?).to be_truthy
end