{"action":"created","comment":{"url":"https://api.github.com/repos/MarkUsProject/Markus/pulls/comments/31556316","id":31556316,"diff_hunk":"@@ -0,0 +1,628 @@\n+require 'spec_helper'\n+\n+describe SubmissionsController do\n+  \n+  after(:each) do \n+    destroy_repos\n+  end\n+    \n+  describe 'A student working alone' do\n+    before(:each) do\n+      @group = create(:group)\n+      @assignment = create(:assignment,\n+                           allow_web_submits: true,\n+                           group_min: 1)\n+      @grouping = create(:grouping,\n+                         group: @group,\n+                         assignment: @assignment)\n+      @membership = create(:student_membership,\n+                           membership_status: 'inviter',\n+                           grouping: @grouping)\n+      @student = @membership.user\n+    end\n+\n+    it 'should be able to add files' do\n+      file_1 = fixture_file_upload(File.join('/files', 'Shapes.java'),\n+                                             'text/java')\n+      file_2 = fixture_file_upload(File.join('/files', 'TestShapes.java'),\n+                                             'text/java')\n+\n+      expect(@student.has_accepted_grouping_for?(@assignment.id)).to be_truthy\n+      post_as @student,\n+              :update_files,\n+              :assignment_id => @assignment.id,\n+              :new_files => [file_1, file_2]\n+\n+      # must not respond with redirect_to (see comment in\n+      # app/controllers/submission_controller.rb#update_files)\n+      is_expected.to respond_with(:success)\n+      \n+      # update_files action assert assign to various instance variables.\n+      # These are crucial for the file_manager view to work properly.\n+      expect(assigns :assignment).to_not be_nil\n+      expect(assigns :grouping).to_not be_nil\n+      expect(assigns :path).to_not be_nil\n+      expect(assigns :revision).to_not be_nil\n+      expect(assigns :files).to_not be_nil\n+      expect(assigns :missing_assignment_files).to_not be_nil\n+\n+      # Check to see if the file was added\n+      @grouping.group.access_repo do |repo|\n+        revision = repo.get_latest_revision\n+        files = revision.files_at_path(@assignment.repository_folder)\n+        expect(files['Shapes.java']).to_not be_nil\n+        expect(files['TestShapes.java']).to_not be_nil\n+      end\n+    end\n+\n+    it 'should be able to populate a file' do\n+      get_as @student,\n+             :populate_file_manager_react,\n+             assignment_id: @assignment.id,\n+             format: 'js'\n+      is_expected.to respond_with(:success)\n+    end\n+\n+\n+    it 'should be able to access file manager page' do\n+      get_as @student, :file_manager, :assignment_id => @assignment.id\n+      is_expected.to respond_with(:success)\n+      # file_manager action assert assign to various instance variables.\n+      # These are crucial for the file_manager view to work properly.\n+      expect(assigns :assignment).to_not be_nil\n+      expect(assigns :grouping).to_not be_nil\n+      expect(assigns :path).to_not be_nil\n+      expect(assigns :revision).to_not be_nil\n+      expect(assigns :files).to_not be_nil\n+      expect(assigns :missing_assignment_files).to_not be_nil\n+    end\n+\n+    #TODO figure out how to test this test into the one above\n+    #TODO Figure out how to remove fixture_file_upload\n+    it 'should be able to replace files' do\n+      expect(@student.has_accepted_grouping_for?(@assignment.id)).to be_truthy\n+      \n+      @grouping.group.access_repo do |repo|\n+        txn = repo.get_transaction('markus')\n+        # overwrite and commit both files\n+        txn.add(File.join(@assignment.repository_folder,'Shapes.java'),\n+                'Content of Shapes.java')\n+        txn.add(File.join(@assignment.repository_folder, 'TestShapes.java'),\n+                'Content of TestShapes.java')\n+        repo.commit(txn)\n+        \n+        # revision 2\n+        revision = repo.get_latest_revision\n+        old_files = revision.files_at_path(@assignment.repository_folder)\n+        old_file_1 = old_files['Shapes.java']\n+        old_file_2 = old_files['TestShapes.java']\n+\n+        @file_1 = fixture_file_upload(File.join('/files', 'Shapes.java'),\n+                                      'text/java')\n+        @file_2 = fixture_file_upload(File.join('/files', 'TestShapes.java'),\n+                                      'text/java')\n+\n+        post_as @student,\n+                :update_files,\n+                assignment_id: @assignment.id,\n+                new_files: [@file_1, @file_2],\n+                file_revisions: { 'Shapes.java'     => old_file_1.from_revision,\n+                                  'TestShapes.java' => old_file_2.from_revision }","path":"spec/controllers/submissions_controller_spec.rb","position":110,"original_position":110,"commit_id":"918f42a6928a3bd437bcf0e02785df75786f86f7","original_commit_id":"918f42a6928a3bd437bcf0e02785df75786f86f7","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long. [81/80]","created_at":"2015-06-02T18:42:33Z","updated_at":"2015-06-02T18:42:33Z","html_url":"https://github.com/MarkUsProject/Markus/pull/2177#discussion_r31556316","pull_request_url":"https://api.github.com/repos/MarkUsProject/Markus/pulls/2177","_links":{"self":{"href":"https://api.github.com/repos/MarkUsProject/Markus/pulls/comments/31556316"},"html":{"href":"https://github.com/MarkUsProject/Markus/pull/2177#discussion_r31556316"},"pull_request":{"href":"https://api.github.com/repos/MarkUsProject/Markus/pulls/2177"}}},"pull_request":{"url":"https://api.github.com/repos/MarkUsProject/Markus/pulls/2177","id":36760536,"html_url":"https://github.com/MarkUsProject/Markus/pull/2177","diff_url":"https://github.com/MarkUsProject/Markus/pull/2177.diff","patch_url":"https://github.com/MarkUsProject/Markus/pull/2177.patch","issue_url":"https://api.github.com/repos/MarkUsProject/Markus/issues/2177","number":2177,"state":"open","locked":false,"title":"Rspec submissions controller","user":{"login":"hootiehoo","id":6080472,"avatar_url":"https://avatars.githubusercontent.com/u/6080472?v=3","gravatar_id":"","url":"https://api.github.com/users/hootiehoo","html_url":"https://github.com/hootiehoo","followers_url":"https://api.github.com/users/hootiehoo/followers","following_url":"https://api.github.com/users/hootiehoo/following{/other_user}","gists_url":"https://api.github.com/users/hootiehoo/gists{/gist_id}","starred_url":"https://api.github.com/users/hootiehoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hootiehoo/subscriptions","organizations_url":"https://api.github.com/users/hootiehoo/orgs","repos_url":"https://api.github.com/users/hootiehoo/repos","events_url":"https://api.github.com/users/hootiehoo/events{/privacy}","received_events_url":"https://api.github.com/users/hootiehoo/received_events","type":"User","site_admin":false},"body":"Created Rspec test file for the submissions controller.","created_at":"2015-06-02T18:42:27Z","updated_at":"2015-06-02T18:42:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e36ad79d49ba4995aa3462dd65747b7d3ff4a1d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MarkUsProject/Markus/pulls/2177/commits","review_comments_url":"https://api.github.com/repos/MarkUsProject/Markus/pulls/2177/comments","review_comment_url":"https://api.github.com/repos/MarkUsProject/Markus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MarkUsProject/Markus/issues/2177/comments","statuses_url":"https://api.github.com/repos/MarkUsProject/Markus/statuses/918f42a6928a3bd437bcf0e02785df75786f86f7","head":{"label":"hootiehoo:rspec-submissions-controller","ref":"rspec-submissions-controller","sha":"918f42a6928a3bd437bcf0e02785df75786f86f7","user":{"login":"hootiehoo","id":6080472,"avatar_url":"https://avatars.githubusercontent.com/u/6080472?v=3","gravatar_id":"","url":"https://api.github.com/users/hootiehoo","html_url":"https://github.com/hootiehoo","followers_url":"https://api.github.com/users/hootiehoo/followers","following_url":"https://api.github.com/users/hootiehoo/following{/other_user}","gists_url":"https://api.github.com/users/hootiehoo/gists{/gist_id}","starred_url":"https://api.github.com/users/hootiehoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hootiehoo/subscriptions","organizations_url":"https://api.github.com/users/hootiehoo/orgs","repos_url":"https://api.github.com/users/hootiehoo/repos","events_url":"https://api.github.com/users/hootiehoo/events{/privacy}","received_events_url":"https://api.github.com/users/hootiehoo/received_events","type":"User","site_admin":false},"repo":{"id":35430363,"name":"Markus","full_name":"hootiehoo/Markus","owner":{"login":"hootiehoo","id":6080472,"avatar_url":"https://avatars.githubusercontent.com/u/6080472?v=3","gravatar_id":"","url":"https://api.github.com/users/hootiehoo","html_url":"https://github.com/hootiehoo","followers_url":"https://api.github.com/users/hootiehoo/followers","following_url":"https://api.github.com/users/hootiehoo/following{/other_user}","gists_url":"https://api.github.com/users/hootiehoo/gists{/gist_id}","starred_url":"https://api.github.com/users/hootiehoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hootiehoo/subscriptions","organizations_url":"https://api.github.com/users/hootiehoo/orgs","repos_url":"https://api.github.com/users/hootiehoo/repos","events_url":"https://api.github.com/users/hootiehoo/events{/privacy}","received_events_url":"https://api.github.com/users/hootiehoo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hootiehoo/Markus","description":"Git repository of MarkUs","fork":true,"url":"https://api.github.com/repos/hootiehoo/Markus","forks_url":"https://api.github.com/repos/hootiehoo/Markus/forks","keys_url":"https://api.github.com/repos/hootiehoo/Markus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hootiehoo/Markus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hootiehoo/Markus/teams","hooks_url":"https://api.github.com/repos/hootiehoo/Markus/hooks","issue_events_url":"https://api.github.com/repos/hootiehoo/Markus/issues/events{/number}","events_url":"https://api.github.com/repos/hootiehoo/Markus/events","assignees_url":"https://api.github.com/repos/hootiehoo/Markus/assignees{/user}","branches_url":"https://api.github.com/repos/hootiehoo/Markus/branches{/branch}","tags_url":"https://api.github.com/repos/hootiehoo/Markus/tags","blobs_url":"https://api.github.com/repos/hootiehoo/Markus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hootiehoo/Markus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hootiehoo/Markus/git/refs{/sha}","trees_url":"https://api.github.com/repos/hootiehoo/Markus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hootiehoo/Markus/statuses/{sha}","languages_url":"https://api.github.com/repos/hootiehoo/Markus/languages","stargazers_url":"https://api.github.com/repos/hootiehoo/Markus/stargazers","contributors_url":"https://api.github.com/repos/hootiehoo/Markus/contributors","subscribers_url":"https://api.github.com/repos/hootiehoo/Markus/subscribers","subscription_url":"https://api.github.com/repos/hootiehoo/Markus/subscription","commits_url":"https://api.github.com/repos/hootiehoo/Markus/commits{/sha}","git_commits_url":"https://api.github.com/repos/hootiehoo/Markus/git/commits{/sha}","comments_url":"https://api.github.com/repos/hootiehoo/Markus/comments{/number}","issue_comment_url":"https://api.github.com/repos/hootiehoo/Markus/issues/comments{/number}","contents_url":"https://api.github.com/repos/hootiehoo/Markus/contents/{+path}","compare_url":"https://api.github.com/repos/hootiehoo/Markus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hootiehoo/Markus/merges","archive_url":"https://api.github.com/repos/hootiehoo/Markus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hootiehoo/Markus/downloads","issues_url":"https://api.github.com/repos/hootiehoo/Markus/issues{/number}","pulls_url":"https://api.github.com/repos/hootiehoo/Markus/pulls{/number}","milestones_url":"https://api.github.com/repos/hootiehoo/Markus/milestones{/number}","notifications_url":"https://api.github.com/repos/hootiehoo/Markus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hootiehoo/Markus/labels{/name}","releases_url":"https://api.github.com/repos/hootiehoo/Markus/releases{/id}","created_at":"2015-05-11T14:52:13Z","updated_at":"2015-05-11T14:52:17Z","pushed_at":"2015-06-02T18:40:58Z","git_url":"git://github.com/hootiehoo/Markus.git","ssh_url":"git@github.com:hootiehoo/Markus.git","clone_url":"https://github.com/hootiehoo/Markus.git","svn_url":"https://github.com/hootiehoo/Markus","homepage":"http://www.markusproject.org","size":22521,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"MarkUsProject:master","ref":"master","sha":"1183682d8d96e47208f48387b488638b966a8c93","user":{"login":"MarkUsProject","id":415874,"avatar_url":"https://avatars.githubusercontent.com/u/415874?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkUsProject","html_url":"https://github.com/MarkUsProject","followers_url":"https://api.github.com/users/MarkUsProject/followers","following_url":"https://api.github.com/users/MarkUsProject/following{/other_user}","gists_url":"https://api.github.com/users/MarkUsProject/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkUsProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkUsProject/subscriptions","organizations_url":"https://api.github.com/users/MarkUsProject/orgs","repos_url":"https://api.github.com/users/MarkUsProject/repos","events_url":"https://api.github.com/users/MarkUsProject/events{/privacy}","received_events_url":"https://api.github.com/users/MarkUsProject/received_events","type":"Organization","site_admin":false},"repo":{"id":940538,"name":"Markus","full_name":"MarkUsProject/Markus","owner":{"login":"MarkUsProject","id":415874,"avatar_url":"https://avatars.githubusercontent.com/u/415874?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkUsProject","html_url":"https://github.com/MarkUsProject","followers_url":"https://api.github.com/users/MarkUsProject/followers","following_url":"https://api.github.com/users/MarkUsProject/following{/other_user}","gists_url":"https://api.github.com/users/MarkUsProject/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkUsProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkUsProject/subscriptions","organizations_url":"https://api.github.com/users/MarkUsProject/orgs","repos_url":"https://api.github.com/users/MarkUsProject/repos","events_url":"https://api.github.com/users/MarkUsProject/events{/privacy}","received_events_url":"https://api.github.com/users/MarkUsProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MarkUsProject/Markus","description":"Git repository of MarkUs","fork":false,"url":"https://api.github.com/repos/MarkUsProject/Markus","forks_url":"https://api.github.com/repos/MarkUsProject/Markus/forks","keys_url":"https://api.github.com/repos/MarkUsProject/Markus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MarkUsProject/Markus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MarkUsProject/Markus/teams","hooks_url":"https://api.github.com/repos/MarkUsProject/Markus/hooks","issue_events_url":"https://api.github.com/repos/MarkUsProject/Markus/issues/events{/number}","events_url":"https://api.github.com/repos/MarkUsProject/Markus/events","assignees_url":"https://api.github.com/repos/MarkUsProject/Markus/assignees{/user}","branches_url":"https://api.github.com/repos/MarkUsProject/Markus/branches{/branch}","tags_url":"https://api.github.com/repos/MarkUsProject/Markus/tags","blobs_url":"https://api.github.com/repos/MarkUsProject/Markus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MarkUsProject/Markus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MarkUsProject/Markus/git/refs{/sha}","trees_url":"https://api.github.com/repos/MarkUsProject/Markus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MarkUsProject/Markus/statuses/{sha}","languages_url":"https://api.github.com/repos/MarkUsProject/Markus/languages","stargazers_url":"https://api.github.com/repos/MarkUsProject/Markus/stargazers","contributors_url":"https://api.github.com/repos/MarkUsProject/Markus/contributors","subscribers_url":"https://api.github.com/repos/MarkUsProject/Markus/subscribers","subscription_url":"https://api.github.com/repos/MarkUsProject/Markus/subscription","commits_url":"https://api.github.com/repos/MarkUsProject/Markus/commits{/sha}","git_commits_url":"https://api.github.com/repos/MarkUsProject/Markus/git/commits{/sha}","comments_url":"https://api.github.com/repos/MarkUsProject/Markus/comments{/number}","issue_comment_url":"https://api.github.com/repos/MarkUsProject/Markus/issues/comments{/number}","contents_url":"https://api.github.com/repos/MarkUsProject/Markus/contents/{+path}","compare_url":"https://api.github.com/repos/MarkUsProject/Markus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MarkUsProject/Markus/merges","archive_url":"https://api.github.com/repos/MarkUsProject/Markus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MarkUsProject/Markus/downloads","issues_url":"https://api.github.com/repos/MarkUsProject/Markus/issues{/number}","pulls_url":"https://api.github.com/repos/MarkUsProject/Markus/pulls{/number}","milestones_url":"https://api.github.com/repos/MarkUsProject/Markus/milestones{/number}","notifications_url":"https://api.github.com/repos/MarkUsProject/Markus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MarkUsProject/Markus/labels{/name}","releases_url":"https://api.github.com/repos/MarkUsProject/Markus/releases{/id}","created_at":"2010-09-26T16:18:08Z","updated_at":"2015-05-11T07:04:07Z","pushed_at":"2015-06-02T18:42:29Z","git_url":"git://github.com/MarkUsProject/Markus.git","ssh_url":"git@github.com:MarkUsProject/Markus.git","clone_url":"https://github.com/MarkUsProject/Markus.git","svn_url":"https://github.com/MarkUsProject/Markus","homepage":"http://www.markusproject.org","size":50250,"stargazers_count":125,"watchers_count":125,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":152,"mirror_url":null,"open_issues_count":95,"forks":152,"open_issues":95,"watchers":125,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MarkUsProject/Markus/pulls/2177"},"html":{"href":"https://github.com/MarkUsProject/Markus/pull/2177"},"issue":{"href":"https://api.github.com/repos/MarkUsProject/Markus/issues/2177"},"comments":{"href":"https://api.github.com/repos/MarkUsProject/Markus/issues/2177/comments"},"review_comments":{"href":"https://api.github.com/repos/MarkUsProject/Markus/pulls/2177/comments"},"review_comment":{"href":"https://api.github.com/repos/MarkUsProject/Markus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MarkUsProject/Markus/pulls/2177/commits"},"statuses":{"href":"https://api.github.com/repos/MarkUsProject/Markus/statuses/918f42a6928a3bd437bcf0e02785df75786f86f7"}}}}