{"action":"created","issue":{"url":"https://api.github.com/repos/rspec/rspec-expectations/issues/957","repository_url":"https://api.github.com/repos/rspec/rspec-expectations","labels_url":"https://api.github.com/repos/rspec/rspec-expectations/issues/957/labels{/name}","comments_url":"https://api.github.com/repos/rspec/rspec-expectations/issues/957/comments","events_url":"https://api.github.com/repos/rspec/rspec-expectations/issues/957/events","html_url":"https://github.com/rspec/rspec-expectations/issues/957","id":193238885,"number":957,"title":"Response with wrong body","user":{"login":"FlorianGerhardt","id":1536510,"avatar_url":"https://avatars.githubusercontent.com/u/1536510?v=3","gravatar_id":"","url":"https://api.github.com/users/FlorianGerhardt","html_url":"https://github.com/FlorianGerhardt","followers_url":"https://api.github.com/users/FlorianGerhardt/followers","following_url":"https://api.github.com/users/FlorianGerhardt/following{/other_user}","gists_url":"https://api.github.com/users/FlorianGerhardt/gists{/gist_id}","starred_url":"https://api.github.com/users/FlorianGerhardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlorianGerhardt/subscriptions","organizations_url":"https://api.github.com/users/FlorianGerhardt/orgs","repos_url":"https://api.github.com/users/FlorianGerhardt/repos","events_url":"https://api.github.com/users/FlorianGerhardt/events{/privacy}","received_events_url":"https://api.github.com/users/FlorianGerhardt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-02T23:00:58Z","updated_at":"2016-12-03T16:52:54Z","closed_at":"2016-12-03T10:34:33Z","body":"Hey there!\r\nI'm getting errors when I'm checking the update action of my controller, it seems to me that the response in the expectation differs from the actual response.\r\n\r\nThe spec: \r\n```\r\n\r\nlet (:project) { Project.create! valid_attributes }\r\n\r\nlet(:valid_attributes) {\r\n    { title: 'title', description: 'description'}\r\n  }\r\n\r\nlet(:new_attributes) {\r\n    { title: 'title-updated', description: 'description-updated' }\r\n  }\r\n\r\nit \"updates the requested project\" do\r\n     \r\n      put :update, id: project.to_param, project: new_attributes\r\n\r\n      expect(response.body['title']).to eq(new_attributes[:title])\r\n      expect(response.body['description']).to eq(new_attributes[:description])\r\n      expect(response).to have_http_status(201)\r\n    end\r\n```\r\n\r\nThe error:\r\n```\r\nFailure/Error: expect(response.body['title']).to eq(new_attributes[:title])\r\n\r\n       expected: \"title-updated\"\r\n            got: \"title\"\r\n```\r\n\r\nThe weird thing is, when I print the response.body, it shows the updated values. \r\n"},"comment":{"url":"https://api.github.com/repos/rspec/rspec-expectations/issues/comments/264650751","html_url":"https://github.com/rspec/rspec-expectations/issues/957#issuecomment-264650751","issue_url":"https://api.github.com/repos/rspec/rspec-expectations/issues/957","id":264650751,"user":{"login":"FlorianGerhardt","id":1536510,"avatar_url":"https://avatars.githubusercontent.com/u/1536510?v=3","gravatar_id":"","url":"https://api.github.com/users/FlorianGerhardt","html_url":"https://github.com/FlorianGerhardt","followers_url":"https://api.github.com/users/FlorianGerhardt/followers","following_url":"https://api.github.com/users/FlorianGerhardt/following{/other_user}","gists_url":"https://api.github.com/users/FlorianGerhardt/gists{/gist_id}","starred_url":"https://api.github.com/users/FlorianGerhardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlorianGerhardt/subscriptions","organizations_url":"https://api.github.com/users/FlorianGerhardt/orgs","repos_url":"https://api.github.com/users/FlorianGerhardt/repos","events_url":"https://api.github.com/users/FlorianGerhardt/events{/privacy}","received_events_url":"https://api.github.com/users/FlorianGerhardt/received_events","type":"User","site_admin":false},"created_at":"2016-12-03T16:52:54Z","updated_at":"2016-12-03T16:52:54Z","body":"After some more tests with assigning the response to a variable, I still get the same error, here is the updated code:\r\n\r\n`it \"updates the requested project\" do\r\n     \r\n     saved_response =  put :update, id: project.to_param, project: new_attributes\r\n\r\n      expect(saved_response .body['title']).to eq(new_attributes[:title])\r\n      expect(saved_response .body['description']).to eq(new_attributes[:description])\r\n      expect(saved_response ).to have_http_status(201)\r\n    end`\r\n\r\nAny ideas where this could be coming from if its not rspec? Running Rails 4.2.7.1 mostly vanilla, just rack-cors for cross origin requests."}}
{"actor":{"display_login":"FlorianGerhardt"}}