{"action":"created","comment":{"url":"https://api.github.com/repos/artiator/artiator-backend/pulls/comments/76816054","id":76816054,"diff_hunk":"@@ -0,0 +1,105 @@\n+# frozen_string_literal: true\n+\n+require 'rails_helper'\n+\n+RSpec.describe FeedsController, type: :controller do\n+  describe 'GET #index' do\n+    let!(:feeds) { create_list :feed, 5 }\n+\n+    before { get :index, format: :json }\n+\n+    it { is_expected.to respond_with :success }\n+\n+    it 'return feeds' do\n+      data = JSON.parse response.body, symbolize_names: true\n+\n+      expect(data[:feeds].count).to eq feeds.count\n+\n+      feeds.each_with_index do |feed, index|\n+        expect(data[:feeds][index][:id]).to    eq feed.id\n+        expect(data[:feeds][index][:name]).to  eq feed.name\n+      end\n+    end\n+  end\n+\n+  describe 'GET #show' do\n+    context 'when record exists' do\n+      let!(:feed) { create :feed }\n+\n+      before { get :show, id: feed.id, format: :json }\n+\n+      it { is_expected.to respond_with :success }\n+\n+      it 'return feed' do\n+        data = JSON.parse response.body, symbolize_names: true\n+\n+        expect(data[:feed][:id]).to    eq feed.id\n+        expect(data[:feed][:name]).to  eq feed.name\n+      end\n+    end\n+\n+    context 'when record does not exist' do\n+      before { get :show, id: 1, format: :json }\n+\n+      it { is_expected.to respond_with :not_found }\n+    end\n+  end\n+\n+  describe 'POST #create' do\n+    before { post :create, feed: feed_attributes, format: :json }\n+\n+    context 'with valid attributes' do\n+      let(:feed_attributes) { attributes_for :feed }\n+\n+      it { is_expected.to respond_with :success }\n+\n+      it 'create feed' do\n+        expect(Feed.count).to eq 1\n+\n+        expect(Feed.last.name).to eq feed_attributes[:name]\n+      end\n+\n+      it 'return feed' do\n+        data = JSON.parse response.body, symbolize_names: true\n+        feed = Feed.last\n+\n+        expect(data[:feed][:id]).to   eq feed.id\n+        expect(data[:feed][:name]).to eq feed.name\n+      end\n+    end\n+  end\n+\n+  describe 'PATCH #update' do\n+    before :each do\n+      @feed = create(:feed, name: 'extrafeed')\n+    end\n+\n+    context 'valid attributes' do\n+      it 'changes the contacts attributes' do\n+        patch :update, id: @feed, feed: FactoryGirl.attributes_for(:feed, name: 'test')\n+        @feed.reload\n+        expect(@feed.name).to eq 'test'\n+        expect(response.status).to eq 200\n+      end\n+    end\n+\n+    context 'with invalid attributes' do\n+      it 'do not change ' do","path":"spec/controllers/feeds_controller_spec.rb","position":87,"original_position":87,"commit_id":"e2e7cc785aa3abcf2be22e2fe32d7847ebdcdf87","original_commit_id":"e2e7cc785aa3abcf2be22e2fe32d7847ebdcdf87","user":{"login":"meoweg","id":15604058,"avatar_url":"https://avatars.githubusercontent.com/u/15604058?v=3","gravatar_id":"","url":"https://api.github.com/users/meoweg","html_url":"https://github.com/meoweg","followers_url":"https://api.github.com/users/meoweg/followers","following_url":"https://api.github.com/users/meoweg/following{/other_user}","gists_url":"https://api.github.com/users/meoweg/gists{/gist_id}","starred_url":"https://api.github.com/users/meoweg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meoweg/subscriptions","organizations_url":"https://api.github.com/users/meoweg/orgs","repos_url":"https://api.github.com/users/meoweg/repos","events_url":"https://api.github.com/users/meoweg/events{/privacy}","received_events_url":"https://api.github.com/users/meoweg/received_events","type":"User","site_admin":false},"body":"Test that model attributes are not changed.","created_at":"2016-08-30T15:15:05Z","updated_at":"2016-08-30T15:15:05Z","html_url":"https://github.com/artiator/artiator-backend/pull/6#discussion_r76816054","pull_request_url":"https://api.github.com/repos/artiator/artiator-backend/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/artiator/artiator-backend/pulls/comments/76816054"},"html":{"href":"https://github.com/artiator/artiator-backend/pull/6#discussion_r76816054"},"pull_request":{"href":"https://api.github.com/repos/artiator/artiator-backend/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/artiator/artiator-backend/pulls/6","id":83258701,"html_url":"https://github.com/artiator/artiator-backend/pull/6","diff_url":"https://github.com/artiator/artiator-backend/pull/6.diff","patch_url":"https://github.com/artiator/artiator-backend/pull/6.patch","issue_url":"https://api.github.com/repos/artiator/artiator-backend/issues/6","number":6,"state":"open","locked":false,"title":"Add feed controller","user":{"login":"max1on1","id":17139069,"avatar_url":"https://avatars.githubusercontent.com/u/17139069?v=3","gravatar_id":"","url":"https://api.github.com/users/max1on1","html_url":"https://github.com/max1on1","followers_url":"https://api.github.com/users/max1on1/followers","following_url":"https://api.github.com/users/max1on1/following{/other_user}","gists_url":"https://api.github.com/users/max1on1/gists{/gist_id}","starred_url":"https://api.github.com/users/max1on1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max1on1/subscriptions","organizations_url":"https://api.github.com/users/max1on1/orgs","repos_url":"https://api.github.com/users/max1on1/repos","events_url":"https://api.github.com/users/max1on1/events{/privacy}","received_events_url":"https://api.github.com/users/max1on1/received_events","type":"User","site_admin":false},"body":"Add feed controller and test for feed controller.","created_at":"2016-08-30T12:06:46Z","updated_at":"2016-08-30T15:15:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/artiator/artiator-backend/pulls/6/commits","review_comments_url":"https://api.github.com/repos/artiator/artiator-backend/pulls/6/comments","review_comment_url":"https://api.github.com/repos/artiator/artiator-backend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/artiator/artiator-backend/issues/6/comments","statuses_url":"https://api.github.com/repos/artiator/artiator-backend/statuses/e2e7cc785aa3abcf2be22e2fe32d7847ebdcdf87","head":{"label":"artiator:add-feed-controller","ref":"add-feed-controller","sha":"e2e7cc785aa3abcf2be22e2fe32d7847ebdcdf87","user":{"login":"artiator","id":20752247,"avatar_url":"https://avatars.githubusercontent.com/u/20752247?v=3","gravatar_id":"","url":"https://api.github.com/users/artiator","html_url":"https://github.com/artiator","followers_url":"https://api.github.com/users/artiator/followers","following_url":"https://api.github.com/users/artiator/following{/other_user}","gists_url":"https://api.github.com/users/artiator/gists{/gist_id}","starred_url":"https://api.github.com/users/artiator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artiator/subscriptions","organizations_url":"https://api.github.com/users/artiator/orgs","repos_url":"https://api.github.com/users/artiator/repos","events_url":"https://api.github.com/users/artiator/events{/privacy}","received_events_url":"https://api.github.com/users/artiator/received_events","type":"Organization","site_admin":false},"repo":{"id":64858303,"name":"artiator-backend","full_name":"artiator/artiator-backend","owner":{"login":"artiator","id":20752247,"avatar_url":"https://avatars.githubusercontent.com/u/20752247?v=3","gravatar_id":"","url":"https://api.github.com/users/artiator","html_url":"https://github.com/artiator","followers_url":"https://api.github.com/users/artiator/followers","following_url":"https://api.github.com/users/artiator/following{/other_user}","gists_url":"https://api.github.com/users/artiator/gists{/gist_id}","starred_url":"https://api.github.com/users/artiator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artiator/subscriptions","organizations_url":"https://api.github.com/users/artiator/orgs","repos_url":"https://api.github.com/users/artiator/repos","events_url":"https://api.github.com/users/artiator/events{/privacy}","received_events_url":"https://api.github.com/users/artiator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/artiator/artiator-backend","description":"JSON API server for The Artiator","fork":false,"url":"https://api.github.com/repos/artiator/artiator-backend","forks_url":"https://api.github.com/repos/artiator/artiator-backend/forks","keys_url":"https://api.github.com/repos/artiator/artiator-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/artiator/artiator-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/artiator/artiator-backend/teams","hooks_url":"https://api.github.com/repos/artiator/artiator-backend/hooks","issue_events_url":"https://api.github.com/repos/artiator/artiator-backend/issues/events{/number}","events_url":"https://api.github.com/repos/artiator/artiator-backend/events","assignees_url":"https://api.github.com/repos/artiator/artiator-backend/assignees{/user}","branches_url":"https://api.github.com/repos/artiator/artiator-backend/branches{/branch}","tags_url":"https://api.github.com/repos/artiator/artiator-backend/tags","blobs_url":"https://api.github.com/repos/artiator/artiator-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/artiator/artiator-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/artiator/artiator-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/artiator/artiator-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/artiator/artiator-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/artiator/artiator-backend/languages","stargazers_url":"https://api.github.com/repos/artiator/artiator-backend/stargazers","contributors_url":"https://api.github.com/repos/artiator/artiator-backend/contributors","subscribers_url":"https://api.github.com/repos/artiator/artiator-backend/subscribers","subscription_url":"https://api.github.com/repos/artiator/artiator-backend/subscription","commits_url":"https://api.github.com/repos/artiator/artiator-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/artiator/artiator-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/artiator/artiator-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/artiator/artiator-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/artiator/artiator-backend/contents/{+path}","compare_url":"https://api.github.com/repos/artiator/artiator-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/artiator/artiator-backend/merges","archive_url":"https://api.github.com/repos/artiator/artiator-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/artiator/artiator-backend/downloads","issues_url":"https://api.github.com/repos/artiator/artiator-backend/issues{/number}","pulls_url":"https://api.github.com/repos/artiator/artiator-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/artiator/artiator-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/artiator/artiator-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/artiator/artiator-backend/labels{/name}","releases_url":"https://api.github.com/repos/artiator/artiator-backend/releases{/id}","deployments_url":"https://api.github.com/repos/artiator/artiator-backend/deployments","created_at":"2016-08-03T15:43:16Z","updated_at":"2016-08-03T18:02:17Z","pushed_at":"2016-08-30T12:06:47Z","git_url":"git://github.com/artiator/artiator-backend.git","ssh_url":"git@github.com:artiator/artiator-backend.git","clone_url":"https://github.com/artiator/artiator-backend.git","svn_url":"https://github.com/artiator/artiator-backend","homepage":"","size":83,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"artiator:master","ref":"master","sha":"ecf09ec53ab7e52ddc76a950ec0a25df145001b3","user":{"login":"artiator","id":20752247,"avatar_url":"https://avatars.githubusercontent.com/u/20752247?v=3","gravatar_id":"","url":"https://api.github.com/users/artiator","html_url":"https://github.com/artiator","followers_url":"https://api.github.com/users/artiator/followers","following_url":"https://api.github.com/users/artiator/following{/other_user}","gists_url":"https://api.github.com/users/artiator/gists{/gist_id}","starred_url":"https://api.github.com/users/artiator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artiator/subscriptions","organizations_url":"https://api.github.com/users/artiator/orgs","repos_url":"https://api.github.com/users/artiator/repos","events_url":"https://api.github.com/users/artiator/events{/privacy}","received_events_url":"https://api.github.com/users/artiator/received_events","type":"Organization","site_admin":false},"repo":{"id":64858303,"name":"artiator-backend","full_name":"artiator/artiator-backend","owner":{"login":"artiator","id":20752247,"avatar_url":"https://avatars.githubusercontent.com/u/20752247?v=3","gravatar_id":"","url":"https://api.github.com/users/artiator","html_url":"https://github.com/artiator","followers_url":"https://api.github.com/users/artiator/followers","following_url":"https://api.github.com/users/artiator/following{/other_user}","gists_url":"https://api.github.com/users/artiator/gists{/gist_id}","starred_url":"https://api.github.com/users/artiator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artiator/subscriptions","organizations_url":"https://api.github.com/users/artiator/orgs","repos_url":"https://api.github.com/users/artiator/repos","events_url":"https://api.github.com/users/artiator/events{/privacy}","received_events_url":"https://api.github.com/users/artiator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/artiator/artiator-backend","description":"JSON API server for The Artiator","fork":false,"url":"https://api.github.com/repos/artiator/artiator-backend","forks_url":"https://api.github.com/repos/artiator/artiator-backend/forks","keys_url":"https://api.github.com/repos/artiator/artiator-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/artiator/artiator-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/artiator/artiator-backend/teams","hooks_url":"https://api.github.com/repos/artiator/artiator-backend/hooks","issue_events_url":"https://api.github.com/repos/artiator/artiator-backend/issues/events{/number}","events_url":"https://api.github.com/repos/artiator/artiator-backend/events","assignees_url":"https://api.github.com/repos/artiator/artiator-backend/assignees{/user}","branches_url":"https://api.github.com/repos/artiator/artiator-backend/branches{/branch}","tags_url":"https://api.github.com/repos/artiator/artiator-backend/tags","blobs_url":"https://api.github.com/repos/artiator/artiator-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/artiator/artiator-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/artiator/artiator-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/artiator/artiator-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/artiator/artiator-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/artiator/artiator-backend/languages","stargazers_url":"https://api.github.com/repos/artiator/artiator-backend/stargazers","contributors_url":"https://api.github.com/repos/artiator/artiator-backend/contributors","subscribers_url":"https://api.github.com/repos/artiator/artiator-backend/subscribers","subscription_url":"https://api.github.com/repos/artiator/artiator-backend/subscription","commits_url":"https://api.github.com/repos/artiator/artiator-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/artiator/artiator-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/artiator/artiator-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/artiator/artiator-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/artiator/artiator-backend/contents/{+path}","compare_url":"https://api.github.com/repos/artiator/artiator-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/artiator/artiator-backend/merges","archive_url":"https://api.github.com/repos/artiator/artiator-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/artiator/artiator-backend/downloads","issues_url":"https://api.github.com/repos/artiator/artiator-backend/issues{/number}","pulls_url":"https://api.github.com/repos/artiator/artiator-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/artiator/artiator-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/artiator/artiator-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/artiator/artiator-backend/labels{/name}","releases_url":"https://api.github.com/repos/artiator/artiator-backend/releases{/id}","deployments_url":"https://api.github.com/repos/artiator/artiator-backend/deployments","created_at":"2016-08-03T15:43:16Z","updated_at":"2016-08-03T18:02:17Z","pushed_at":"2016-08-30T12:06:47Z","git_url":"git://github.com/artiator/artiator-backend.git","ssh_url":"git@github.com:artiator/artiator-backend.git","clone_url":"https://github.com/artiator/artiator-backend.git","svn_url":"https://github.com/artiator/artiator-backend","homepage":"","size":83,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/artiator/artiator-backend/pulls/6"},"html":{"href":"https://github.com/artiator/artiator-backend/pull/6"},"issue":{"href":"https://api.github.com/repos/artiator/artiator-backend/issues/6"},"comments":{"href":"https://api.github.com/repos/artiator/artiator-backend/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/artiator/artiator-backend/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/artiator/artiator-backend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/artiator/artiator-backend/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/artiator/artiator-backend/statuses/e2e7cc785aa3abcf2be22e2fe32d7847ebdcdf87"}}}}
{"actor":{"display_login":"meoweg"}}