GitHub PullRequestReviewCommentEvent at 2014-05-17 06:09:09
Repository: osem
Actor: houndci
Payload: {"comment":{"url":"https://api.github.com/repos/openSUSE/osem/pulls/comments/12766358","id":12766358,"diff_hunk":"@@ -0,0 +1,124 @@\n+require 'spec_helper'\n+\n+feature Conference do\n+  # It is necessary to use bang version of let to build roles before user\n+  let!(:organizer_role) { create(:organizer_role) }\n+  let!(:participant_role) { create(:participant_role) }\n+  let!(:admin_role) { create(:admin_role) }\n+  let(:admin) { create(:admin) }\n+  let(:conference) { create(:conference) }\n+  shared_examples 'volunteer' do |user|\n+    scenario 'adds and updates vdays', feature: true, js: true do\n+      sign_in(admin)\n+      visit admin_conference_volunteers_info_path(\n+        conference_id: conference.short_title)\n+      check('Enable Volunteering')\n+      check('Use vdays')\n+      click_link 'Add vday'\n+      expect(page.all('div.nested-fields').count == 1).to be true\n+      page.\n+      find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').\n+      set(\"#{Date.today.strftime('%Y')}\")\n+      page.\n+      find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').\n+      set(\"#{Date.today.strftime('%B')}\")\n+      page.\n+      find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').\n+      set(\"#{Date.today.strftime('%d')}\")\n+      page.\n+      find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').\n+      set('Example Person')\n+      click_button 'Update Conference'\n+      \n+      expect(flash).\n+      to eq('Volunteering options were successfully updated.')\n+\n+      # Validations\n+      expect(find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').\n+        value).to eq(\"#{Date.today.strftime('%Y')}\")\n+      expect(find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').\n+        value).to eq(\"#{Date.today.month.to_s}\")\n+      expect(find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').\n+        value).to eq(\"#{Date.today.strftime('%d')}\")\n+      expect(\n+        find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').\n+        value).to eq('Example Person')\n+\n+      # Remove vday\n+      click_link 'Remove vday'\n+      expect(page.all('div.nested-fields').count == 0).to be true\n+      click_button 'Update Conference'\n+      expect(flash).to eq('Volunteering options were successfully updated.')\n+      expect(page.all('div.nested-fields').count == 0).to be true\n+      sign_out\n+    end\n+\n+    scenario 'adds and updates vpositions', feature: true, js: true do\n+      sign_in(admin)\n+      visit admin_conference_volunteers_info_path(\n+        conference_id: conference.short_title)\n+      # Adding vday\n+      check('Enable Volunteering')\n+      check('Use vdays')\n+      click_link 'Add vday'\n+      expect(page.all('div.nested-fields').count == 1).to be true\n+      page.\n+      find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').\n+      set(\"#{Date.today.strftime('%Y')}\")\n+      page.\n+      find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').\n+      set(\"#{Date.today.strftime('%B')}\")\n+      page.\n+      find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').\n+      set(\"#{Date.today.strftime('%d')}\")\n+      page.\n+      find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').\n+      set('Example Person')\n+      click_button 'Update Conference'\n+      expect(flash).\n+      to eq('Volunteering options were successfully updated.')\n+      # Add vposition\n+      check('Use vpositions')\n+      click_link 'Add vposition'\n+      expect(page.all('div.nested-fields').count == 2).to be true\n+      page.find(\n+      'div.vpositions div.nested-fields:nth-of-type(1) div:nth-of-type(1) input'\n+      ).set('Example Position')\n+      page.find(\n+      'div.vpositions div.nested-fields:nth-of-type(1) div:nth-of-type(2) textarea'\n+      ).set('Example Description')\n+      find(:css, \n+        \"select[id^='conference_vpositions_attributes_'][id$='_vday_ids']\").\n+          find(:option, \"#{Date.today.strftime}\").select_option\n+      click_button 'Update Conference'\n+      expect(flash).\n+      to eq('Volunteering options were successfully updated.')\n+\n+      # Validations\n+      expect(find(\n+      'div.vpositions div.nested-fields:nth-of-type(1) div:nth-of-type(1) input').","path":"spec/features/volunteers_spec.rb","position":99,"original_position":99,"commit_id":"e0593343f355c7f445268e6ef1416cbc09cd4f67","original_commit_id":"e0593343f355c7f445268e6ef1416cbc09cd4f67","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?","gravatar_id":"38d9cefd9971a05bf447f07c6cd332cc","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. [82/80]","created_at":"2014-05-17T06:09:09Z","updated_at":"2014-05-17T06:09:09Z","html_url":"https://github.com/openSUSE/osem/pull/136#discussion_r12766358","pull_request_url":"https://api.github.com/repos/openSUSE/osem/pulls/136","_links":{"self":{"href":"https://api.github.com/repos/openSUSE/osem/pulls/comments/12766358"},"html":{"href":"https://github.com/openSUSE/osem/pull/136#discussion_r12766358"},"pull_request":{"href":"https://api.github.com/repos/openSUSE/osem/pulls/136"}}}}