{"action":"created","comment":{"url":"https://api.github.com/repos/fsek/web/pulls/comments/62830273","id":62830273,"diff_hunk":"@@ -0,0 +1,101 @@\n+require 'rails_helper'\n+\n+RSpec.describe Admin::MenusController, type: :controller do\n+  let(:user) { create(:admin) }\n+\n+  allow_user_to(:manage, Menu)\n+\n+  before(:each) do\n+    allow(controller).to receive(:current_user) { user }\n+  end\n+\n+  describe 'GET #index' do\n+    it 'assigns a menu grid and categories' do\n+      create(:menu)\n+\n+      get(:index)\n+      response.status.should eq(200)\n+    end\n+  end\n+\n+  describe 'GET #edit' do\n+    it 'assigns given menu as @menu' do\n+      menu = create(:menu)\n+\n+      get(:edit, id: menu.to_param)\n+      assigns(:menu).should eq(menu)\n+    end\n+  end\n+\n+  describe 'GET #new' do\n+    it 'assigns a new menu as @menu' do\n+      get(:new)\n+      assigns(:menu).instance_of?(Menu).should be_truthy\n+      assigns(:menu).new_record?.should be_truthy\n+    end\n+  end\n+\n+  describe 'POST #create' do\n+    it 'valid parameters' do\n+      attributes = { name: 'Bildgalleri',\n+                     location: 'guild',\n+                     index: 1337,\n+                     link: '/galleri',\n+                     visible: true,\n+                     turbolinks: false,\n+                     blank_p: false }\n+\n+      lambda do\n+        post :create, menu: attributes\n+      end.should change(Menu, :count).by(1)\n+\n+      response.should redirect_to(admin_menus_path)\n+      Menu.last.name.should eq('Bildgalleri')\n+    end\n+\n+    it 'invalid parameters' do\n+      lambda do\n+        post :create, menu: { name: '' }\n+      end.should change(Menu, :count).by(0)\n+\n+      response.status.should eq(422)\n+      response.should render_template(:new)\n+    end\n+  end\n+\n+  describe 'PATCH #update' do\n+    it 'valid parameters' do\n+      menu = create(:menu, name: 'Aftonbladet')\n+\n+      patch :update, id: menu.to_param, menu: { name: 'Bildgalleri' }\n+      menu.reload\n+\n+      response.should redirect_to(edit_admin_menu_path(menu))\n+      menu.name.should eq('Bildgalleri')\n+    end\n+\n+    it 'invalid parameters' do\n+      menu = create(:menu, name: 'Bildgalleri')\n+\n+      patch :update, id: menu.to_param, menu: { name: '' }\n+      menu.reload\n+\n+      menu.name.should eq('Bildgalleri')\n+      response.status.should eq(422)\n+      response.should render_template(:edit)\n+    end\n+  end\n+\n+  describe 'DELETE #destroy' do\n+    it 'valid parameters' do\n+      menu = create(:menu)\n+\n+      lambda do\n+        delete :destroy, id: menu.to_param\n+      end.should change(Menu, :count).by(-1)\n+\n+      response.should redirect_to(admin_menus_path)\n+    end\n+  end\n+end\n+","path":"spec/controllers/menus_controller_spec.rb","position":101,"original_position":101,"commit_id":"007b1320658b9b8d2c3e0b281d708fe79340466d","original_commit_id":"007b1320658b9b8d2c3e0b281d708fe79340466d","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","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":"1 trailing blank lines detected.","created_at":"2016-05-11T11:19:29Z","updated_at":"2016-05-11T11:19:29Z","html_url":"https://github.com/fsek/web/pull/391#discussion_r62830273","pull_request_url":"https://api.github.com/repos/fsek/web/pulls/391","_links":{"self":{"href":"https://api.github.com/repos/fsek/web/pulls/comments/62830273"},"html":{"href":"https://github.com/fsek/web/pull/391#discussion_r62830273"},"pull_request":{"href":"https://api.github.com/repos/fsek/web/pulls/391"}}},"pull_request":{"url":"https://api.github.com/repos/fsek/web/pulls/391","id":69654802,"html_url":"https://github.com/fsek/web/pull/391","diff_url":"https://github.com/fsek/web/pull/391.diff","patch_url":"https://github.com/fsek/web/pull/391.patch","issue_url":"https://api.github.com/repos/fsek/web/issues/391","number":391,"state":"open","locked":false,"title":"David specs","user":{"login":"davidwessman","id":6763624,"avatar_url":"https://avatars.githubusercontent.com/u/6763624?v=3","gravatar_id":"","url":"https://api.github.com/users/davidwessman","html_url":"https://github.com/davidwessman","followers_url":"https://api.github.com/users/davidwessman/followers","following_url":"https://api.github.com/users/davidwessman/following{/other_user}","gists_url":"https://api.github.com/users/davidwessman/gists{/gist_id}","starred_url":"https://api.github.com/users/davidwessman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidwessman/subscriptions","organizations_url":"https://api.github.com/users/davidwessman/orgs","repos_url":"https://api.github.com/users/davidwessman/repos","events_url":"https://api.github.com/users/davidwessman/events{/privacy}","received_events_url":"https://api.github.com/users/davidwessman/received_events","type":"User","site_admin":false},"body":"- Menu: move to admin namespace\r\n- Rspec config: changing database cleaning\r\n- Feature specs: removing some obsolete admin specs\r\n- Model specs: minimize database interactions\r\n- Rewriting some feature specs to use Warden for sign in instead of clicking\r\n- Google analytics: use environment variable instead","created_at":"2016-05-11T11:19:12Z","updated_at":"2016-05-11T11:19:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"386332d544933a9182df03f61f4bddd5006e2ebc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fsek/web/pulls/391/commits","review_comments_url":"https://api.github.com/repos/fsek/web/pulls/391/comments","review_comment_url":"https://api.github.com/repos/fsek/web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fsek/web/issues/391/comments","statuses_url":"https://api.github.com/repos/fsek/web/statuses/007b1320658b9b8d2c3e0b281d708fe79340466d","head":{"label":"fsek:david-specs","ref":"david-specs","sha":"007b1320658b9b8d2c3e0b281d708fe79340466d","user":{"login":"fsek","id":10084654,"avatar_url":"https://avatars.githubusercontent.com/u/10084654?v=3","gravatar_id":"","url":"https://api.github.com/users/fsek","html_url":"https://github.com/fsek","followers_url":"https://api.github.com/users/fsek/followers","following_url":"https://api.github.com/users/fsek/following{/other_user}","gists_url":"https://api.github.com/users/fsek/gists{/gist_id}","starred_url":"https://api.github.com/users/fsek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsek/subscriptions","organizations_url":"https://api.github.com/users/fsek/orgs","repos_url":"https://api.github.com/users/fsek/repos","events_url":"https://api.github.com/users/fsek/events{/privacy}","received_events_url":"https://api.github.com/users/fsek/received_events","type":"Organization","site_admin":false},"repo":{"id":27583674,"name":"web","full_name":"fsek/web","owner":{"login":"fsek","id":10084654,"avatar_url":"https://avatars.githubusercontent.com/u/10084654?v=3","gravatar_id":"","url":"https://api.github.com/users/fsek","html_url":"https://github.com/fsek","followers_url":"https://api.github.com/users/fsek/followers","following_url":"https://api.github.com/users/fsek/following{/other_user}","gists_url":"https://api.github.com/users/fsek/gists{/gist_id}","starred_url":"https://api.github.com/users/fsek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsek/subscriptions","organizations_url":"https://api.github.com/users/fsek/orgs","repos_url":"https://api.github.com/users/fsek/repos","events_url":"https://api.github.com/users/fsek/events{/privacy}","received_events_url":"https://api.github.com/users/fsek/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fsek/web","description":"F-sektionens webbplats","fork":false,"url":"https://api.github.com/repos/fsek/web","forks_url":"https://api.github.com/repos/fsek/web/forks","keys_url":"https://api.github.com/repos/fsek/web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fsek/web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fsek/web/teams","hooks_url":"https://api.github.com/repos/fsek/web/hooks","issue_events_url":"https://api.github.com/repos/fsek/web/issues/events{/number}","events_url":"https://api.github.com/repos/fsek/web/events","assignees_url":"https://api.github.com/repos/fsek/web/assignees{/user}","branches_url":"https://api.github.com/repos/fsek/web/branches{/branch}","tags_url":"https://api.github.com/repos/fsek/web/tags","blobs_url":"https://api.github.com/repos/fsek/web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fsek/web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fsek/web/git/refs{/sha}","trees_url":"https://api.github.com/repos/fsek/web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fsek/web/statuses/{sha}","languages_url":"https://api.github.com/repos/fsek/web/languages","stargazers_url":"https://api.github.com/repos/fsek/web/stargazers","contributors_url":"https://api.github.com/repos/fsek/web/contributors","subscribers_url":"https://api.github.com/repos/fsek/web/subscribers","subscription_url":"https://api.github.com/repos/fsek/web/subscription","commits_url":"https://api.github.com/repos/fsek/web/commits{/sha}","git_commits_url":"https://api.github.com/repos/fsek/web/git/commits{/sha}","comments_url":"https://api.github.com/repos/fsek/web/comments{/number}","issue_comment_url":"https://api.github.com/repos/fsek/web/issues/comments{/number}","contents_url":"https://api.github.com/repos/fsek/web/contents/{+path}","compare_url":"https://api.github.com/repos/fsek/web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fsek/web/merges","archive_url":"https://api.github.com/repos/fsek/web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fsek/web/downloads","issues_url":"https://api.github.com/repos/fsek/web/issues{/number}","pulls_url":"https://api.github.com/repos/fsek/web/pulls{/number}","milestones_url":"https://api.github.com/repos/fsek/web/milestones{/number}","notifications_url":"https://api.github.com/repos/fsek/web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fsek/web/labels{/name}","releases_url":"https://api.github.com/repos/fsek/web/releases{/id}","deployments_url":"https://api.github.com/repos/fsek/web/deployments","created_at":"2014-12-05T09:13:19Z","updated_at":"2016-04-21T13:42:48Z","pushed_at":"2016-05-11T11:19:12Z","git_url":"git://github.com/fsek/web.git","ssh_url":"git@github.com:fsek/web.git","clone_url":"https://github.com/fsek/web.git","svn_url":"https://github.com/fsek/web","homepage":"https://fsektionen.se","size":214551,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":41,"forks":2,"open_issues":41,"watchers":5,"default_branch":"master"}},"base":{"label":"fsek:master","ref":"master","sha":"8d2fc8511b1779b01be8aefddde8ae39f4257051","user":{"login":"fsek","id":10084654,"avatar_url":"https://avatars.githubusercontent.com/u/10084654?v=3","gravatar_id":"","url":"https://api.github.com/users/fsek","html_url":"https://github.com/fsek","followers_url":"https://api.github.com/users/fsek/followers","following_url":"https://api.github.com/users/fsek/following{/other_user}","gists_url":"https://api.github.com/users/fsek/gists{/gist_id}","starred_url":"https://api.github.com/users/fsek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsek/subscriptions","organizations_url":"https://api.github.com/users/fsek/orgs","repos_url":"https://api.github.com/users/fsek/repos","events_url":"https://api.github.com/users/fsek/events{/privacy}","received_events_url":"https://api.github.com/users/fsek/received_events","type":"Organization","site_admin":false},"repo":{"id":27583674,"name":"web","full_name":"fsek/web","owner":{"login":"fsek","id":10084654,"avatar_url":"https://avatars.githubusercontent.com/u/10084654?v=3","gravatar_id":"","url":"https://api.github.com/users/fsek","html_url":"https://github.com/fsek","followers_url":"https://api.github.com/users/fsek/followers","following_url":"https://api.github.com/users/fsek/following{/other_user}","gists_url":"https://api.github.com/users/fsek/gists{/gist_id}","starred_url":"https://api.github.com/users/fsek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsek/subscriptions","organizations_url":"https://api.github.com/users/fsek/orgs","repos_url":"https://api.github.com/users/fsek/repos","events_url":"https://api.github.com/users/fsek/events{/privacy}","received_events_url":"https://api.github.com/users/fsek/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fsek/web","description":"F-sektionens webbplats","fork":false,"url":"https://api.github.com/repos/fsek/web","forks_url":"https://api.github.com/repos/fsek/web/forks","keys_url":"https://api.github.com/repos/fsek/web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fsek/web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fsek/web/teams","hooks_url":"https://api.github.com/repos/fsek/web/hooks","issue_events_url":"https://api.github.com/repos/fsek/web/issues/events{/number}","events_url":"https://api.github.com/repos/fsek/web/events","assignees_url":"https://api.github.com/repos/fsek/web/assignees{/user}","branches_url":"https://api.github.com/repos/fsek/web/branches{/branch}","tags_url":"https://api.github.com/repos/fsek/web/tags","blobs_url":"https://api.github.com/repos/fsek/web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fsek/web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fsek/web/git/refs{/sha}","trees_url":"https://api.github.com/repos/fsek/web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fsek/web/statuses/{sha}","languages_url":"https://api.github.com/repos/fsek/web/languages","stargazers_url":"https://api.github.com/repos/fsek/web/stargazers","contributors_url":"https://api.github.com/repos/fsek/web/contributors","subscribers_url":"https://api.github.com/repos/fsek/web/subscribers","subscription_url":"https://api.github.com/repos/fsek/web/subscription","commits_url":"https://api.github.com/repos/fsek/web/commits{/sha}","git_commits_url":"https://api.github.com/repos/fsek/web/git/commits{/sha}","comments_url":"https://api.github.com/repos/fsek/web/comments{/number}","issue_comment_url":"https://api.github.com/repos/fsek/web/issues/comments{/number}","contents_url":"https://api.github.com/repos/fsek/web/contents/{+path}","compare_url":"https://api.github.com/repos/fsek/web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fsek/web/merges","archive_url":"https://api.github.com/repos/fsek/web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fsek/web/downloads","issues_url":"https://api.github.com/repos/fsek/web/issues{/number}","pulls_url":"https://api.github.com/repos/fsek/web/pulls{/number}","milestones_url":"https://api.github.com/repos/fsek/web/milestones{/number}","notifications_url":"https://api.github.com/repos/fsek/web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fsek/web/labels{/name}","releases_url":"https://api.github.com/repos/fsek/web/releases{/id}","deployments_url":"https://api.github.com/repos/fsek/web/deployments","created_at":"2014-12-05T09:13:19Z","updated_at":"2016-04-21T13:42:48Z","pushed_at":"2016-05-11T11:19:12Z","git_url":"git://github.com/fsek/web.git","ssh_url":"git@github.com:fsek/web.git","clone_url":"https://github.com/fsek/web.git","svn_url":"https://github.com/fsek/web","homepage":"https://fsektionen.se","size":214551,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":41,"forks":2,"open_issues":41,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fsek/web/pulls/391"},"html":{"href":"https://github.com/fsek/web/pull/391"},"issue":{"href":"https://api.github.com/repos/fsek/web/issues/391"},"comments":{"href":"https://api.github.com/repos/fsek/web/issues/391/comments"},"review_comments":{"href":"https://api.github.com/repos/fsek/web/pulls/391/comments"},"review_comment":{"href":"https://api.github.com/repos/fsek/web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fsek/web/pulls/391/commits"},"statuses":{"href":"https://api.github.com/repos/fsek/web/statuses/007b1320658b9b8d2c3e0b281d708fe79340466d"}}}}