Skip to content

Commit

Permalink
Fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
hunchr committed Aug 21, 2024
1 parent 253d896 commit ed180b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions app/models/person/data_quality_issue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ def severity=(value)
def message
I18n.t("activemodel.errors.models.person.data_quality_issue.message",
attr: Person.human_attribute_name(attr),
key: I18n.t(key, scope: "activemodel.errors.models.data_quality_issue.messages"),
default: key)
key: I18n.t(key,
default: key,
scope: "activemodel.errors.models.data_quality_issue.messages"))
end

private
Expand Down
4 changes: 2 additions & 2 deletions spec/models/person/data_quality_issue_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
describe Person::DataQualityIssue do
let(:person) { people(:mitglied) }
let(:data_quality) do
person.data_quality_issues.new(attr: "zip_code", key: "ist leer", severity: "warning")
person.data_quality_issues.new(attr: "zip_code", key: "empty", severity: "warning")
end

describe "validations" do
Expand All @@ -28,7 +28,7 @@

context "#key" do
it "is invalid if it isnt unique within a [person_id, attr] scope" do
person.data_quality_issues.create!(attr: "zip_code", key: "ist leer", severity: "error")
person.data_quality_issues.create!(attr: "zip_code", key: "empty", severity: "error")
expect(data_quality.valid?).to eq false
expect(data_quality.errors[:key]).to eq ["ist bereits vergeben"]
end
Expand Down

0 comments on commit ed180b1

Please sign in to comment.