Skip to content

Commit

Permalink
add test validate option for save
Browse files Browse the repository at this point in the history
  • Loading branch information
Giallombardo Nathan committed May 30, 2024
1 parent 132bcf2 commit 12aeb6d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/persistence_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,16 @@ class ModelWithValidations < CouchbaseOrm::Base
}) }.to raise_error(ActiveModel::UnknownAttributeError)
end

it "should not perform validation with validate true" do
model = ModelWithValidations.new

expect(model.valid?).to be(false)
expect(model.save(validate: false)).to be(true)
expect(model.persisted?).to be(true)

model.destroy
end

describe BasicModel do
it_behaves_like "ActiveModel"
end
Expand Down

0 comments on commit 12aeb6d

Please sign in to comment.