Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #36590 - fix ACS error message for duplicate words #10647

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def validate_each(record, attribute, value)
product = ::Katello::Product.find(value)
content_type = record.alternate_content_source.content_type
if product.repositories.with_type(content_type).has_url.empty?
record.errors[attribute] << N_("The product %{name} has no %{type} repositories with upstream URLs to add to the alternate content source.") % { name: product.name, type: content_type }
record.errors.add(attribute, _("%{name} has no %{type} repositories with upstream URLs to add to the alternate content source.") % { name: product.name, type: content_type })
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/models/katello/alternate_content_source_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_cannot_add_product_if_repo_has_no_url
@simplified_acs.products << repo_no_url.product
end

assert_equal "Validation failed: Product The product #{repo_no_url.product.name} has no yum repositories with upstream URLs to add to the alternate content source.", error.message
assert_equal "Validation failed: Product #{repo_no_url.product.name} has no yum repositories with upstream URLs to add to the alternate content source.", error.message
end

def test_cannot_add_product_with_no_repositories
Expand All @@ -54,7 +54,7 @@ def test_cannot_add_product_with_no_repositories
@simplified_acs.products << empty_product
end

assert_equal "Validation failed: Product The product #{empty_product.name} has no yum repositories with upstream URLs to add to the alternate content source.", error.message
assert_equal "Validation failed: Product #{empty_product.name} has no yum repositories with upstream URLs to add to the alternate content source.", error.message
end

def test_subpaths
Expand Down