Bug fix: CeleryScript errors were using non-human readable #inspect method instead of #name
parent
ac9ea0c45c
commit
1e0e033caf
|
@ -92,7 +92,7 @@ module CeleryScript
|
|||
message = (FRIENDLY_ERRORS.dig(kind, parent.kind) || BAD_LEAF) % {
|
||||
kind: kind,
|
||||
parent_kind: parent.kind,
|
||||
allowed: allowed,
|
||||
allowed: allowed.map(&:name),
|
||||
actual: actual
|
||||
}
|
||||
|
||||
|
|
|
@ -108,8 +108,10 @@ describe Api::RegimensController do
|
|||
] }
|
||||
post :create, body: payload.to_json, format: :json
|
||||
expect(response.status).to eq(422)
|
||||
expect(json.fetch(:error))
|
||||
.to include("but got nothing")
|
||||
msg = json.fetch(:error)
|
||||
expect(msg).to include("but got nothing")
|
||||
# Make sure corpus entries are properly formatted.
|
||||
expect(msg).to include('"coordinate",')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -68,6 +68,9 @@ describe Api::SequencesController do
|
|||
post :create, body: input.to_json, params: {format: :json}
|
||||
expect(response.status).to eq(422)
|
||||
expect(Sequence.last).to_not be
|
||||
xpectd = "Expected leaf 'wait' within 'sequence' to be one of: "\
|
||||
"[\"scope_declaration\"] but got wait"
|
||||
expect(json.fetch(:body)).to eq(xpectd)
|
||||
end
|
||||
|
||||
it 'strips excess `args`' do
|
||||
|
@ -114,6 +117,7 @@ describe Api::SequencesController do
|
|||
sign_in user
|
||||
post :create, body: input.to_json, params: {format: :json}
|
||||
expect(response.status).to eq(422)
|
||||
expect(json.fetch(:body)).to include('"tool"')
|
||||
expect(json[:body]).to include("Expected leaf 'wait' within "\
|
||||
"'parameter_declaration' to be one of: [")
|
||||
end
|
||||
|
@ -320,6 +324,7 @@ describe Api::SequencesController do
|
|||
}
|
||||
post :create, body: input.to_json, params: {format: :json}
|
||||
expect(response.status).to eq(422)
|
||||
expect(json.fetch(:body)).to include('"point"')
|
||||
expect(json[:body]).to include("but got sync")
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue