rspecテストを実行してこれを実行する方法を説明するいくつかのSOの投稿を見ました。しかし、ブレークポイントに達すると、私は有用な情報を表示するのに苦労しています。以下のコードでは、コンソールからレスポンスオブジェクトを確認したいと考えています。pryデバッガでrspec変数を調べる方法
describe 'happenings' do
context "#index (GET /api/v1/flat_happenings.json)" do
before(:each) do
30.times { FactoryGirl.create(:flat_happening) }
get "/api/v1/flat_happenings.json"
end
describe "should list all flat_happenings" do
binding.pry
it { JSON.parse(response.body)["flat_happenings"].length.should eq 30 }
end
end
end
どのようにすればいいですか?
ありがとうございました。だからシンプル - なぜ私はそのことを考えなかった... – klavado