{"action":"created","issue":{"url":"https://api.github.com/repos/rspec/rspec-mocks/issues/1031","labels_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/1031/labels{/name}","comments_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/1031/comments","events_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/1031/events","html_url":"https://github.com/rspec/rspec-mocks/issues/1031","id":114925579,"number":1031,"title":"BooksController :create action test with rails 4.2 and rspec","user":{"login":"ulugbekov","id":684972,"avatar_url":"https://avatars.githubusercontent.com/u/684972?v=3","gravatar_id":"","url":"https://api.github.com/users/ulugbekov","html_url":"https://github.com/ulugbekov","followers_url":"https://api.github.com/users/ulugbekov/followers","following_url":"https://api.github.com/users/ulugbekov/following{/other_user}","gists_url":"https://api.github.com/users/ulugbekov/gists{/gist_id}","starred_url":"https://api.github.com/users/ulugbekov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulugbekov/subscriptions","organizations_url":"https://api.github.com/users/ulugbekov/orgs","repos_url":"https://api.github.com/users/ulugbekov/repos","events_url":"https://api.github.com/users/ulugbekov/events{/privacy}","received_events_url":"https://api.github.com/users/ulugbekov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2015-11-03T22:31:42Z","updated_at":"2015-11-08T09:10:11Z","closed_at":"2015-11-04T03:31:59Z","body":"```\r\ndescribe BooksController do\r\n describe 'POST create' do\r\n    let!(:book) { mock_model('Book') }\r\n\r\n  it 'sends new message to Book' do\r\n    params = {name: 'Ruby'}\r\n    #Book.method(:new).arity is -1, which means any arguments.\r\n\r\n    allow(Book).to receive(:new).with(params) { book }\r\n    post :create, book: params\r\n  end\r\nend\r\n```\r\n\r\nArgumentError:\r\n       wrong number of arguments (1 for 0)\r\n\r\nWhy is it complaining?"},"comment":{"url":"https://api.github.com/repos/rspec/rspec-mocks/issues/comments/154790503","html_url":"https://github.com/rspec/rspec-mocks/issues/1031#issuecomment-154790503","issue_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/1031","id":154790503,"user":{"login":"ulugbekov","id":684972,"avatar_url":"https://avatars.githubusercontent.com/u/684972?v=3","gravatar_id":"","url":"https://api.github.com/users/ulugbekov","html_url":"https://github.com/ulugbekov","followers_url":"https://api.github.com/users/ulugbekov/followers","following_url":"https://api.github.com/users/ulugbekov/following{/other_user}","gists_url":"https://api.github.com/users/ulugbekov/gists{/gist_id}","starred_url":"https://api.github.com/users/ulugbekov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulugbekov/subscriptions","organizations_url":"https://api.github.com/users/ulugbekov/orgs","repos_url":"https://api.github.com/users/ulugbekov/repos","events_url":"https://api.github.com/users/ulugbekov/events{/privacy}","received_events_url":"https://api.github.com/users/ulugbekov/received_events","type":"User","site_admin":false},"created_at":"2015-11-08T09:10:11Z","updated_at":"2015-11-08T09:10:11Z","body":":)\r\nIt is ok. I will be using latest your approach. Do not want to have other headaches on my way of testing. Thanks for heads up.\r\n"}}