{"action":"created","issue":{"url":"https://api.github.com/repos/r7kamura/rspec-request_describer/issues/3","labels_url":"https://api.github.com/repos/r7kamura/rspec-request_describer/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/r7kamura/rspec-request_describer/issues/3/comments","events_url":"https://api.github.com/repos/r7kamura/rspec-request_describer/issues/3/events","html_url":"https://github.com/r7kamura/rspec-request_describer/issues/3","id":69532990,"number":3,"title":"Must explicit invoke `should`?","user":{"login":"lazywei","id":2840571,"avatar_url":"https://avatars.githubusercontent.com/u/2840571?v=3","gravatar_id":"","url":"https://api.github.com/users/lazywei","html_url":"https://github.com/lazywei","followers_url":"https://api.github.com/users/lazywei/followers","following_url":"https://api.github.com/users/lazywei/following{/other_user}","gists_url":"https://api.github.com/users/lazywei/gists{/gist_id}","starred_url":"https://api.github.com/users/lazywei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lazywei/subscriptions","organizations_url":"https://api.github.com/users/lazywei/orgs","repos_url":"https://api.github.com/users/lazywei/repos","events_url":"https://api.github.com/users/lazywei/events{/privacy}","received_events_url":"https://api.github.com/users/lazywei/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-20T08:13:55Z","updated_at":"2015-04-20T08:48:08Z","closed_at":"2015-04-20T08:39:39Z","body":"Hi,\r\n\r\nI found that if I'm using\r\n\r\n```\r\nit { should == 200 }\r\n```\r\n\r\nit will works. But if I'm using\r\n\r\n```\r\nit \"....\" do\r\n  expect(JSON.parse(response.body)[\"username\"]).to eq(\"lazywei\")\r\nend\r\n```\r\n\r\nthen it will raise error that `response` is `nil`.\r\n\r\nI'll need to invoke the `subject` explicitly before using `response`\r\n\r\n```\r\nit \"....\" do\r\n  should == 200\r\n  expect(JSON.parse(response.body)[\"username\"]).to eq(\"lazywei\")\r\nend\r\n```\r\n\r\nI don't think this \"implicity\" is good design. IMHO, I'd prefer I can call `post ...` or something like `do_request` explicitly by myself. This makes the test case more readable.\r\nHow do you think?\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/r7kamura/rspec-request_describer/issues/comments/94395978","html_url":"https://github.com/r7kamura/rspec-request_describer/issues/3#issuecomment-94395978","issue_url":"https://api.github.com/repos/r7kamura/rspec-request_describer/issues/3","id":94395978,"user":{"login":"lazywei","id":2840571,"avatar_url":"https://avatars.githubusercontent.com/u/2840571?v=3","gravatar_id":"","url":"https://api.github.com/users/lazywei","html_url":"https://github.com/lazywei","followers_url":"https://api.github.com/users/lazywei/followers","following_url":"https://api.github.com/users/lazywei/following{/other_user}","gists_url":"https://api.github.com/users/lazywei/gists{/gist_id}","starred_url":"https://api.github.com/users/lazywei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lazywei/subscriptions","organizations_url":"https://api.github.com/users/lazywei/orgs","repos_url":"https://api.github.com/users/lazywei/repos","events_url":"https://api.github.com/users/lazywei/events{/privacy}","received_events_url":"https://api.github.com/users/lazywei/received_events","type":"User","site_admin":false},"created_at":"2015-04-20T08:48:08Z","updated_at":"2015-04-20T08:48:08Z","body":"I like all the good stuff in this library. I'm just wondering if it is possible to add a syntax sugar like\r\n```\r\ndef do_request\r\n  subject\r\nend\r\n```\r\nso that I can have testing case like\r\n\r\n```\r\nit \"should blahblahblah\" do\r\n  do_request\r\n  expect(response.status).to eq(200)\r\n  expect(response.body).to other_things\r\nend\r\n```"}}