{"action":"created","comment":{"url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/pulls/comments/127576125","pull_request_review_id":50181527,"id":127576125,"diff_hunk":"@@ -1,17 +1,71 @@\n require 'rails_helper'\n \n-RSpec.describe ActionController::Base do\n-  it 'exposes the deserialization mapping via the jsonapi_pointers method' do\n-    pointers = { id: '/data/id', type: '/data/type' }\n-\n-    allow(subject).to receive(:request) do\n-      OpenStruct.new(\n-        env: {\n-          JSONAPI::Rails::ActionController::JSONAPI_POINTERS_KEY => pointers\n+describe ActionController::Base, type: :controller do\n+  describe '.deserializable_resource' do\n+    controller do\n+      deserializable_resource :user\n+\n+      def create\n+        render plain: 'ok'\n+      end\n+    end\n+\n+    let(:payload) do\n+      {\n+        _jsonapi: {\n+          'data' => {\n+            'type' => 'users',\n+            'attributes' => { 'foo' => 'bar', 'bar' => 'baz' }\n+          }\n         }\n-      )\n+      }\n     end\n \n-    expect(subject.send(:jsonapi_pointers)).to equal pointers\n+    it 'makes the deserialized resource available in params' do\n+      post :create, params: payload\n+\n+      expected = { 'type' => 'users', 'foo' => 'bar', 'bar' => 'baz' }\n+      expect(controller.params[:user]).to eq(expected)\n+    end\n+\n+    it 'makes the deserialization mapping available via #jsonapi_pointers' do\n+      post :create, params: payload\n+\n+      expected = { foo: '/data/attributes/foo',\n+                   bar: '/data/attributes/bar',\n+                   type: '/data/type' }\n+      expect(controller.jsonapi_pointers).to eq(expected)\n+    end\n+  end\n+\n+  describe '#render jsonapi:' do\n+    controller do\n+      def index\n+        serializer = Class.new(JSONAPI::Serializable::Resource) do\n+          type :users\n+          attribute :name\n+        end\n+        user = OpenStruct.new(id: 1, name: 'Lucas')\n+\n+        render jsonapi: user, class: serializer\n+      end\n+    end\n+\n+    subject { JSON.parse(response.body) }\n+    let(:serialized_user) do\n+      {\n+        'data' => {\n+          'id' => '1',\n+          'type' => 'users',\n+          'attributes' => { 'name' => 'Lucas' } }","path":"spec/action_controller_spec.rb","position":70,"original_position":70,"commit_id":"2121d36a563e382d8a020c0448815684b39833f4","original_commit_id":"2121d36a563e382d8a020c0448815684b39833f4","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars4.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Closing hash brace must be on the line after the last hash element when opening brace is on a separate line from the first hash element.","created_at":"2017-07-15T04:11:35Z","updated_at":"2017-07-15T04:11:35Z","html_url":"https://github.com/jsonapi-rb/jsonapi-rails/pull/33#discussion_r127576125","pull_request_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/pulls/comments/127576125"},"html":{"href":"https://github.com/jsonapi-rb/jsonapi-rails/pull/33#discussion_r127576125"},"pull_request":{"href":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/pulls/33","id":130702257,"html_url":"https://github.com/jsonapi-rb/jsonapi-rails/pull/33","diff_url":"https://github.com/jsonapi-rb/jsonapi-rails/pull/33.diff","patch_url":"https://github.com/jsonapi-rb/jsonapi-rails/pull/33.patch","issue_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/issues/33","number":33,"state":"open","locked":false,"title":"Improve specs","user":{"login":"beauby","id":2215778,"avatar_url":"https://avatars7.githubusercontent.com/u/2215778?v=4","gravatar_id":"","url":"https://api.github.com/users/beauby","html_url":"https://github.com/beauby","followers_url":"https://api.github.com/users/beauby/followers","following_url":"https://api.github.com/users/beauby/following{/other_user}","gists_url":"https://api.github.com/users/beauby/gists{/gist_id}","starred_url":"https://api.github.com/users/beauby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beauby/subscriptions","organizations_url":"https://api.github.com/users/beauby/orgs","repos_url":"https://api.github.com/users/beauby/repos","events_url":"https://api.github.com/users/beauby/events{/privacy}","received_events_url":"https://api.github.com/users/beauby/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-07-15T03:50:19Z","updated_at":"2017-07-15T04:11:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fdd5fe20dabab57fc00d7c62f9853d8b88cfc957","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/pulls/33/commits","review_comments_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/pulls/33/comments","review_comment_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/issues/33/comments","statuses_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/statuses/2121d36a563e382d8a020c0448815684b39833f4","head":{"label":"jsonapi-rb:improve-specs","ref":"improve-specs","sha":"2121d36a563e382d8a020c0448815684b39833f4","user":{"login":"jsonapi-rb","id":23066863,"avatar_url":"https://avatars5.githubusercontent.com/u/23066863?v=4","gravatar_id":"","url":"https://api.github.com/users/jsonapi-rb","html_url":"https://github.com/jsonapi-rb","followers_url":"https://api.github.com/users/jsonapi-rb/followers","following_url":"https://api.github.com/users/jsonapi-rb/following{/other_user}","gists_url":"https://api.github.com/users/jsonapi-rb/gists{/gist_id}","starred_url":"https://api.github.com/users/jsonapi-rb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsonapi-rb/subscriptions","organizations_url":"https://api.github.com/users/jsonapi-rb/orgs","repos_url":"https://api.github.com/users/jsonapi-rb/repos","events_url":"https://api.github.com/users/jsonapi-rb/events{/privacy}","received_events_url":"https://api.github.com/users/jsonapi-rb/received_events","type":"Organization","site_admin":false},"repo":{"id":71955649,"name":"jsonapi-rails","full_name":"jsonapi-rb/jsonapi-rails","owner":{"login":"jsonapi-rb","id":23066863,"avatar_url":"https://avatars5.githubusercontent.com/u/23066863?v=4","gravatar_id":"","url":"https://api.github.com/users/jsonapi-rb","html_url":"https://github.com/jsonapi-rb","followers_url":"https://api.github.com/users/jsonapi-rb/followers","following_url":"https://api.github.com/users/jsonapi-rb/following{/other_user}","gists_url":"https://api.github.com/users/jsonapi-rb/gists{/gist_id}","starred_url":"https://api.github.com/users/jsonapi-rb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsonapi-rb/subscriptions","organizations_url":"https://api.github.com/users/jsonapi-rb/orgs","repos_url":"https://api.github.com/users/jsonapi-rb/repos","events_url":"https://api.github.com/users/jsonapi-rb/events{/privacy}","received_events_url":"https://api.github.com/users/jsonapi-rb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jsonapi-rb/jsonapi-rails","description":"Rails gem for fast jsonapi-compliant APIs.","fork":false,"url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails","forks_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/forks","keys_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/teams","hooks_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/hooks","issue_events_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/issues/events{/number}","events_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/events","assignees_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/assignees{/user}","branches_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/branches{/branch}","tags_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/tags","blobs_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/languages","stargazers_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/stargazers","contributors_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/contributors","subscribers_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/subscribers","subscription_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/subscription","commits_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/contents/{+path}","compare_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/merges","archive_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/downloads","issues_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/issues{/number}","pulls_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/labels{/name}","releases_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/releases{/id}","deployments_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/deployments","created_at":"2016-10-26T01:53:44Z","updated_at":"2017-07-06T01:05:06Z","pushed_at":"2017-07-15T04:11:28Z","git_url":"git://github.com/jsonapi-rb/jsonapi-rails.git","ssh_url":"git@github.com:jsonapi-rb/jsonapi-rails.git","clone_url":"https://github.com/jsonapi-rb/jsonapi-rails.git","svn_url":"https://github.com/jsonapi-rb/jsonapi-rails","homepage":"http://jsonapi-rb.org","size":70,"stargazers_count":37,"watchers_count":37,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":11,"forks":6,"open_issues":11,"watchers":37,"default_branch":"master"}},"base":{"label":"jsonapi-rb:master","ref":"master","sha":"0605a29c24ebd40cf940a965c50beecb1e00b35e","user":{"login":"jsonapi-rb","id":23066863,"avatar_url":"https://avatars5.githubusercontent.com/u/23066863?v=4","gravatar_id":"","url":"https://api.github.com/users/jsonapi-rb","html_url":"https://github.com/jsonapi-rb","followers_url":"https://api.github.com/users/jsonapi-rb/followers","following_url":"https://api.github.com/users/jsonapi-rb/following{/other_user}","gists_url":"https://api.github.com/users/jsonapi-rb/gists{/gist_id}","starred_url":"https://api.github.com/users/jsonapi-rb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsonapi-rb/subscriptions","organizations_url":"https://api.github.com/users/jsonapi-rb/orgs","repos_url":"https://api.github.com/users/jsonapi-rb/repos","events_url":"https://api.github.com/users/jsonapi-rb/events{/privacy}","received_events_url":"https://api.github.com/users/jsonapi-rb/received_events","type":"Organization","site_admin":false},"repo":{"id":71955649,"name":"jsonapi-rails","full_name":"jsonapi-rb/jsonapi-rails","owner":{"login":"jsonapi-rb","id":23066863,"avatar_url":"https://avatars5.githubusercontent.com/u/23066863?v=4","gravatar_id":"","url":"https://api.github.com/users/jsonapi-rb","html_url":"https://github.com/jsonapi-rb","followers_url":"https://api.github.com/users/jsonapi-rb/followers","following_url":"https://api.github.com/users/jsonapi-rb/following{/other_user}","gists_url":"https://api.github.com/users/jsonapi-rb/gists{/gist_id}","starred_url":"https://api.github.com/users/jsonapi-rb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsonapi-rb/subscriptions","organizations_url":"https://api.github.com/users/jsonapi-rb/orgs","repos_url":"https://api.github.com/users/jsonapi-rb/repos","events_url":"https://api.github.com/users/jsonapi-rb/events{/privacy}","received_events_url":"https://api.github.com/users/jsonapi-rb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jsonapi-rb/jsonapi-rails","description":"Rails gem for fast jsonapi-compliant APIs.","fork":false,"url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails","forks_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/forks","keys_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/teams","hooks_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/hooks","issue_events_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/issues/events{/number}","events_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/events","assignees_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/assignees{/user}","branches_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/branches{/branch}","tags_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/tags","blobs_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/languages","stargazers_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/stargazers","contributors_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/contributors","subscribers_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/subscribers","subscription_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/subscription","commits_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/contents/{+path}","compare_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/merges","archive_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/downloads","issues_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/issues{/number}","pulls_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/labels{/name}","releases_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/releases{/id}","deployments_url":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/deployments","created_at":"2016-10-26T01:53:44Z","updated_at":"2017-07-06T01:05:06Z","pushed_at":"2017-07-15T04:11:28Z","git_url":"git://github.com/jsonapi-rb/jsonapi-rails.git","ssh_url":"git@github.com:jsonapi-rb/jsonapi-rails.git","clone_url":"https://github.com/jsonapi-rb/jsonapi-rails.git","svn_url":"https://github.com/jsonapi-rb/jsonapi-rails","homepage":"http://jsonapi-rb.org","size":70,"stargazers_count":37,"watchers_count":37,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":11,"forks":6,"open_issues":11,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/pulls/33"},"html":{"href":"https://github.com/jsonapi-rb/jsonapi-rails/pull/33"},"issue":{"href":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/issues/33"},"comments":{"href":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/jsonapi-rb/jsonapi-rails/statuses/2121d36a563e382d8a020c0448815684b39833f4"}}}}
{"actor":{"display_login":"houndci-bot"}}