From 9379586fad0fb837de751d0bc4970a2875bb15c3 Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Wed, 13 Jul 2016 06:51:36 +0300 Subject: [PATCH] Remove cocoon and volunteers tests. --- Gemfile | 1 - Gemfile.lock | 11 +- app/assets/javascripts/application.js | 1 - spec/features/volunteers_spec.rb | 122 ------------------ .../admin/volunteers/index.html.haml_spec.rb | 28 ---- .../admin/volunteers/show.html.haml_spec.rb | 5 - 6 files changed, 3 insertions(+), 165 deletions(-) delete mode 100644 spec/features/volunteers_spec.rb delete mode 100644 spec/views/admin/volunteers/index.html.haml_spec.rb delete mode 100644 spec/views/admin/volunteers/show.html.haml_spec.rb diff --git a/Gemfile b/Gemfile index 01bd5af1..1ffefdef 100644 --- a/Gemfile +++ b/Gemfile @@ -75,7 +75,6 @@ gem 'bootstrap-sass', '~> 3.3.4.1' gem 'autoprefixer-rails' gem 'formtastic-bootstrap' gem 'formtastic', '~> 3.1.1' -gem 'cocoon' # as the JavaScript library gem 'jquery-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 4647f23c..80333359 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -115,7 +115,6 @@ GEM cloudinary (1.1.6) aws_cf_signer rest-client - cocoon (1.2.6) coderay (1.1.0) coffee-rails (4.1.1) coffee-script (>= 2.2.0) @@ -358,15 +357,15 @@ GEM rails-assets-bootstrap (~> 3) rails-assets-date.format (1.2.3) rails-assets-holderjs (2.9.3) - rails-assets-jquery (2.2.1) + rails-assets-jquery (2.2.4) rails-assets-jquery-smooth-scroll (1.7.2) rails-assets-jquery (>= 1.4.2) rails-assets-markdown (0.5.0) - rails-assets-momentjs (2.11.2) + rails-assets-momentjs (2.13.0) rails-assets-spectrum (1.8.0) rails-assets-jquery (>= 1.7.2) rails-assets-tinycolor (1.3.0) - rails-assets-to-markdown (1.3.0) + rails-assets-to-markdown (3.0.0) rails-assets-trianglify (0.4.0) rails-assets-waypoints (4.0.0) rails-deprecated_sanitizer (1.0.3) @@ -546,7 +545,6 @@ DEPENDENCIES carrierwave-bombshelter chart-js-rails cloudinary - cocoon country_select coveralls daemons @@ -620,6 +618,3 @@ DEPENDENCIES web-console (~> 2.0) webmock whenever - -BUNDLED WITH - 1.12.5 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index fc21cd27..7ea80169 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -16,7 +16,6 @@ //= require waypoints/jquery.waypoints //= require dataTables/jquery.dataTables //= require dataTables/bootstrap/3/jquery.dataTables.bootstrap -//= require cocoon //= require bootstrap //= require Chart //= require osem diff --git a/spec/features/volunteers_spec.rb b/spec/features/volunteers_spec.rb deleted file mode 100644 index d3aa88cd..00000000 --- a/spec/features/volunteers_spec.rb +++ /dev/null @@ -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 diff --git a/spec/views/admin/volunteers/index.html.haml_spec.rb b/spec/views/admin/volunteers/index.html.haml_spec.rb deleted file mode 100644 index 7edef5e5..00000000 --- a/spec/views/admin/volunteers/index.html.haml_spec.rb +++ /dev/null @@ -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 diff --git a/spec/views/admin/volunteers/show.html.haml_spec.rb b/spec/views/admin/volunteers/show.html.haml_spec.rb deleted file mode 100644 index b322f996..00000000 --- a/spec/views/admin/volunteers/show.html.haml_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'spec_helper' - -describe 'admin/volunteers/show' do - pending "add some examples to (or delete) #{__FILE__}" -end