Remove cocoon and volunteers tests.

This commit is contained in:
Stella Rouzi 2016-07-13 06:51:36 +03:00
parent 7a95c43a57
commit 9379586fad
6 changed files with 3 additions and 165 deletions

View file

@ -1,122 +0,0 @@
require 'spec_helper'
feature Conference do
let!(:conference) { create(:conference) }
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
let!(:organizer) { create(:user, role_ids: [organizer_role.id]) }
shared_examples 'volunteer' do
scenario 'adds and updates vdays', feature: true, js: true do
sign_in(organizer)
visit admin_conference_volunteers_info_path(
conference_id: conference.short_title)
check('Enable Volunteering')
check('Use vdays')
# click_link 'Add vday'
# expect(page.all('div.nested-fields').count == 1).to be true
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').
# select("#{Date.today.strftime('%Y')}")
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').
# select("#{Date.today.strftime('%B')}")
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').
# select("#{Date.today.strftime('%-d')}")
# page.
# find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
# set('Example Person')
click_button 'Update Conference'
expect(flash).
to eq('Volunteering options were successfully updated.')
# # Validations
# expect(find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').
# value).to eq("#{Date.today.strftime('%Y')}")
# expect(find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').
# value).to eq("#{Date.today.month}")
# expect(find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').
# value).to eq("#{Date.today.strftime('%-d')}")
# expect(
# find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
# value).to eq('Example Person')
#
# # Remove vday
# click_link 'Remove vday'
# expect(page.all('div.nested-fields').count == 0).to be true
click_button 'Update Conference'
expect(flash).to eq('Volunteering options were successfully updated.')
expect(page.all('div.nested-fields').count == 0).to be true
sign_out
end
scenario 'adds and updates vpositions', feature: true, js: true do
sign_in(organizer)
visit admin_conference_volunteers_info_path(
conference_id: conference.short_title)
# Adding vday
check('Enable Volunteering')
check('Use vdays')
# click_link 'Add vday'
# expect(page.all('div.nested-fields').count == 1).to be true
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').
# select("#{Date.today.strftime('%Y')}")
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').
# select("#{Date.today.strftime('%B')}")
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').
# select("#{Date.today.strftime('%-d')}")
# page.
# find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
# set('Example Person')
click_button 'Update Conference'
expect(flash).
to eq('Volunteering options were successfully updated.')
# Add vposition
check('Use vpositions')
# click_link 'Add vposition'
# expect(page.all('div.nested-fields').count == 2).to be true
# page.find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(1) input').
# set('Example Position')
# page.find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(2) textarea').
# set('Example Description')
# find(:css, "select[id^='conference_vpositions_attributes_']"\
# "[id$='_vday_ids']").
# find(:option, "#{Date.today.strftime}").select_option
click_button 'Update Conference'
expect(flash).
to eq('Volunteering options were successfully updated.')
# Validations
# expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(1) input').
# value).to eq('Example Position')
# expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(2) textarea').
# value).to eq('Example Description')
#
# expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(3) select:nth-of-type(1)').find('option[selected]').
# text).to eq(Date.today.strftime)
# Remove vposition
# click_link 'Remove vposition'
# expect(page.all('div.nested-fields').count == 1).to be true
# click_button 'Update Conference'
expect(flash).to eq('Volunteering options were successfully updated.')
# click_link 'Remove vday'
# expect(page.all('div.nested-fields').count == 0).to be true
sign_out
end
end
describe 'organizer' do
it_behaves_like 'volunteer', :organizer
end
end

View file

@ -1,28 +0,0 @@
require 'spec_helper'
describe 'admin/volunteers/index' do
it 'renders volunteers days as vdays' do
@vday = create(:vday)
@vday.conference.update_attributes(use_volunteers: true, use_vdays: true)
assign :conference, @vday.conference
render
expect(rendered).to have_selector(
"input[checked='checked'][type='checkbox'][value='1']", count: 2)
expect(rendered).to include("#{Date.today.strftime('%Y')}")
expect(rendered).to include("#{Date.today.strftime('%B')}")
expect(rendered).to include("#{Date.today.strftime('%d')}")
expect(rendered).to include('Lorem Ipsum dolsum')
end
it 'renders volunteers positions as vpositions' do
@vposition = create(:vposition)
@vposition.conference.update_attributes(
use_vpositions: true, use_volunteers: true, use_vdays: true)
assign :conference, @vposition.conference
render
expect(rendered).to include("#{Date.today}")
expect(rendered).to include('Example Volunteer Position')
expect(rendered).to include('Lorem Ipsum dolsum')
end
end

View file

@ -1,5 +0,0 @@
require 'spec_helper'
describe 'admin/volunteers/show' do
pending "add some examples to (or delete) #{__FILE__}"
end