Skip to content

Commit

Permalink
Fix tests, still uniqueness validation failing...
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorcruz committed Feb 20, 2025
1 parent 16121be commit 35192ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/models/billing_entity/applied_tax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class AppliedTax < ApplicationRecord

belongs_to :billing_entity
belongs_to :tax

validates :tax_id, uniqueness: {scope: :billing_entity_id}
end
end

Expand Down
3 changes: 0 additions & 3 deletions spec/models/billing_entity/applied_tax_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@
it { is_expected.to belong_to(:billing_entity) }
it { is_expected.to belong_to(:tax) }

it { is_expected.to validate_presence_of(:billing_entity) }
it { is_expected.to validate_presence_of(:tax) }

it { is_expected.to validate_uniqueness_of(:tax_id).scoped_to(:billing_entity_id) }
end

0 comments on commit 35192ae

Please sign in to comment.