Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d1012f1

Browse files
taglialaremear
authored andcommittedMay 24, 2023
Fix a failure in Rails Edge
In Rails Edge, `errors.messages.blank` changed to `Name can’t be blank`, with a typographic apostrophe This commit fetches the error message directly from `I18n` to cover all use cases
1 parent 9243993 commit d1012f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎spec/render_jsonapi_errors_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{
1818
'errors' => [
1919
{
20-
'detail' => 'Name can\'t be blank',
20+
'detail' => "Name #{I18n.t('errors.messages.blank')}",
2121
'title' => 'Invalid name',
2222
'source' => { 'pointer' => '/data/attributes/name' }
2323
},
@@ -64,7 +64,7 @@ def jsonapi_pointers
6464
def create
6565
errors = [
6666
{
67-
detail: 'Name can\'t be blank',
67+
detail: "Name #{I18n.t('errors.messages.blank')}",
6868
title: 'Invalid name',
6969
source: { pointer: '/data/attributes/name' }
7070
},

0 commit comments

Comments
 (0)
Please sign in to comment.