spec/grape/middleware/formatter_spec.rb in grape-1.5.3 vs spec/grape/middleware/formatter_spec.rb in grape-1.6.0

- old
+ new

@@ -18,11 +18,11 @@ context 'default format' do let(:body) { ['foo'] } it 'calls #to_json since default format is json' do body.instance_eval do - def to_json + def to_json(*_args) '"bar"' end end subject.call('PATH_INFO' => '/somewhere', 'HTTP_ACCEPT' => 'application/json').to_a.last.each { |b| expect(b).to eq('"bar"') } @@ -31,10 +31,10 @@ context 'jsonapi' do let(:body) { { 'foos' => [{ 'bar' => 'baz' }] } } it 'calls #to_json if the content type is jsonapi' do body.instance_eval do - def to_json + def to_json(*_args) '{"foos":[{"bar":"baz"}] }' end end subject.call('PATH_INFO' => '/somewhere', 'HTTP_ACCEPT' => 'application/vnd.api+json').to_a.last.each { |b| expect(b).to eq('{"foos":[{"bar":"baz"}] }') }