问题描述:

I am a complete Ruby and Rails newbie, so please excuse the question. Given a spec making a GET request: get :filter_by_foo, params: {Foo: Bar}

What is the best way to output the generated GET requests?

网友答案:

there should be two variables available to you in the test case called request and response. if i understand your question correctly, you'd want to p request inside your test case

describe SomeController do
  before(:each) { get :filter_by_foo, params: {Foo: Bar} }

  it 'should have some variables available' do
    p request
    # p response
    expect(true).to be(true)
  end
end
相关阅读:
Top