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

Format scope seems to have changed in 0.10.0 #861

Closed
dblock opened this issue Dec 22, 2014 · 2 comments
Closed

Format scope seems to have changed in 0.10.0 #861

dblock opened this issue Dec 22, 2014 · 2 comments
Labels

Comments

@dblock
Copy link
Member

dblock commented Dec 22, 2014

See dblock/grape-on-rails@7b6ebee, I had to move format :json to the top level API to get the formatter in something that was mounted.

@dblock dblock added the bug? label Dec 22, 2014
@dblock
Copy link
Member Author

dblock commented Dec 28, 2014

require 'spec_helper'

describe Grape::API do
  subject do
    api = Class.new(Grape::API) do
      format :json
      resource :table do
        get do
          { ping: 'pong' }
        end
      end
    end

    Class.new(Grape::API) do
      mount api
    end
  end

  def app
    subject
  end

  it 'applies format in the mounted class' do
    get '/table'
    expect(last_response.body).to eq({ ping: 'pong' }.to_json)
  end
end

@dblock
Copy link
Member Author

dblock commented Dec 28, 2014

Fixed in 0c0e85f.

@dblock dblock closed this as completed Dec 28, 2014
dblock added a commit that referenced this issue Dec 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant