Skip to content

Commit 5249e7f

Browse files
authored
Merge pull request #1495 from dblock/fix-1494
Fix: expect a Hashie::Array.
2 parents 220c345 + 0d64512 commit 5249e7f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spec/grape/validations/validators/coerce_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -625,35 +625,35 @@ class User
625625

626626
get '/', a: %w(the other)
627627
expect(last_response.status).to eq(200)
628-
expect(last_response.body).to eq('["the", "other"]')
628+
expect(last_response.body).to eq('#<Hashie::Array ["the", "other"]>')
629629

630630
get '/', a: { a: 1, b: 2 }
631631
expect(last_response.status).to eq(400)
632632
expect(last_response.body).to eq('a is invalid')
633633

634634
get '/', a: [1, 2, 3]
635635
expect(last_response.status).to eq(200)
636-
expect(last_response.body).to eq('["1", "2", "3"]')
636+
expect(last_response.body).to eq('#<Hashie::Array ["1", "2", "3"]>')
637637
end
638638

639639
it 'allows multiple collection types' do
640640
get '/', b: [1, 2, 3]
641641
expect(last_response.status).to eq(200)
642-
expect(last_response.body).to eq('[1, 2, 3]')
642+
expect(last_response.body).to eq('#<Hashie::Array [1, 2, 3]>')
643643

644644
get '/', b: %w(1 2 3)
645645
expect(last_response.status).to eq(200)
646-
expect(last_response.body).to eq('[1, 2, 3]')
646+
expect(last_response.body).to eq('#<Hashie::Array [1, 2, 3]>')
647647

648648
get '/', b: [1, true, 'three']
649649
expect(last_response.status).to eq(200)
650-
expect(last_response.body).to eq('["1", "true", "three"]')
650+
expect(last_response.body).to eq('#<Hashie::Array ["1", "true", "three"]>')
651651
end
652652

653653
it 'allows collections with multiple types' do
654654
get '/', c: [1, '2', true, 'three']
655655
expect(last_response.status).to eq(200)
656-
expect(last_response.body).to eq('[1, 2, "true", "three"]')
656+
expect(last_response.body).to eq('#<Hashie::Array [1, 2, "true", "three"]>')
657657

658658
get '/', d: '1'
659659
expect(last_response.status).to eq(200)

0 commit comments

Comments
 (0)