{"action":"opened","issue":{"url":"https://api.github.com/repos/rspec/rspec-activemodel-mocks/issues/25","repository_url":"https://api.github.com/repos/rspec/rspec-activemodel-mocks","labels_url":"https://api.github.com/repos/rspec/rspec-activemodel-mocks/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/rspec/rspec-activemodel-mocks/issues/25/comments","events_url":"https://api.github.com/repos/rspec/rspec-activemodel-mocks/issues/25/events","html_url":"https://github.com/rspec/rspec-activemodel-mocks/issues/25","id":157676204,"number":25,"title":"Verifying doubles with mock_model","user":{"login":"JasonBarnabe","id":583995,"avatar_url":"https://avatars.githubusercontent.com/u/583995?v=3","gravatar_id":"","url":"https://api.github.com/users/JasonBarnabe","html_url":"https://github.com/JasonBarnabe","followers_url":"https://api.github.com/users/JasonBarnabe/followers","following_url":"https://api.github.com/users/JasonBarnabe/following{/other_user}","gists_url":"https://api.github.com/users/JasonBarnabe/gists{/gist_id}","starred_url":"https://api.github.com/users/JasonBarnabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JasonBarnabe/subscriptions","organizations_url":"https://api.github.com/users/JasonBarnabe/orgs","repos_url":"https://api.github.com/users/JasonBarnabe/repos","events_url":"https://api.github.com/users/JasonBarnabe/events{/privacy}","received_events_url":"https://api.github.com/users/JasonBarnabe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-31T13:48:59Z","updated_at":"2016-05-31T13:48:59Z","closed_at":null,"body":"[Verifying doubles](https://relishapp.com/rspec/rspec-mocks/docs/verifying-doubles) allows you to ensure that you're not mocking up attributes and methods that don't exist on the mocked class. \r\n\r\nrspec-activemodel-mocks should support verifying doubles when using `mock_model`. I was able to enable it by simply changing:\r\n\r\nhttps://github.com/rspec/rspec-activemodel-mocks/blob/f5f8165bf62e8becf31c8f14af26c74504e96467/lib/rspec/active_model/mocks/mocks.rb#L121\r\n```ruby\r\ndouble(\"#{model_class.name}_#{stubs[:id]}\", stubs).tap do |m|\r\n```\r\nto\r\n```ruby\r\ninstance_double(model_class, stubs).tap do |m|\r\n```\r\n\r\nThis works great for how I'm using this gem, but I suspect it might break things for other users, for example if `mock_model` was passed \"A String representing a Class that does not exist\" (?)\r\n\r\nI would be happy to work on a PR if given some advice on how to proceed."}}
{"actor":{"display_login":"JasonBarnabe"}}