diff options
| author | Robert | 2017-06-21 14:52:46 +0200 | 
|---|---|---|
| committer | Robert | 2017-06-22 09:05:19 +0200 | 
| commit | d51985fc2a7c2138fd12cb9116ebf05d8b0e7dac (patch) | |
| tree | 678edcf8dc0c5f956e7969a6aaa1e77f35f73940 /spec/features/calendars_spec.rb | |
| parent | 400898d14514aaf6df991dd2cb73e10b991ae34b (diff) | |
| download | chouette-core-d51985fc2a7c2138fd12cb9116ebf05d8b0e7dac.tar.bz2 | |
Refs: #3595@3h; fixing tests, evaluating timeliness gem :(
Diffstat (limited to 'spec/features/calendars_spec.rb')
| -rw-r--r-- | spec/features/calendars_spec.rb | 82 | 
1 files changed, 0 insertions, 82 deletions
| diff --git a/spec/features/calendars_spec.rb b/spec/features/calendars_spec.rb deleted file mode 100644 index 8c38e7820..000000000 --- a/spec/features/calendars_spec.rb +++ /dev/null @@ -1,82 +0,0 @@ -RSpec.describe 'Calendars', type: :feature do -  login_user - -  let!(:calendars) { Array.new(2) { create :calendar, organisation_id: 1 } } -  let!(:shared_calendar_other_org) { create :calendar, shared: true } -  let!(:unshared_calendar_other_org) { create :calendar } - -  describe 'index' do -    before(:each) { visit calendars_path } - -    it 'displays calendars of the current organisation' do -      expect(page).to have_content(calendars.first.short_name) -      # expect(page).to have_content(shared_calendar_other_org.short_name) -      # expect(page).not_to have_content(unshared_calendar_other_org.short_name) -    end - -    context 'filtering' do -      it 'supports filtering by short name' do -        fill_in 'q[name_or_short_name_cont]', with: calendars.first.short_name -        click_button 'search_btn' -        expect(page).to have_content(calendars.first.short_name) -        expect(page).not_to have_content(calendars.last.short_name) -      end - -      it 'supports filtering by name' do -        fill_in 'q[name_or_short_name_cont]', with: calendars.first.name -        click_button 'search_btn' -        expect(page).to have_content(calendars.first.name) -        expect(page).not_to have_content(calendars.last.name) -      end - - -      it 'supports filtering by shared' do -        shared_calendar = create :calendar, organisation_id: 1, shared: true -        visit calendars_path -        # select I18n.t('true'), from: 'q[shared]' -        find(:css, '#q_shared_true').set(true) -        click_button 'filter_btn' -        expect(page).to have_content(shared_calendar.short_name) -        expect(page).not_to have_content(calendars.first.short_name) -      end - -      # wip -      # it 'supports filtering by date' do -      #   july_calendar = create :calendar, dates: [Date.new(2017, 7, 7)], date_ranges: [Date.new(2017, 7, 15)..Date.new(2017, 7, 30)], organisation_id: 1 -      #   visit calendars_path -      #   select '7', from: 'q_contains_date_3i' -      #   select 'juillet', from: 'q_contains_date_2i' -      #   select '2017', from: 'q_contains_date_1i' -      #   click_button 'filter_btn' -      #   expect(page).to have_content(july_calendar.short_name) -      #   expect(page).not_to have_content(calendars.first.short_name) -      #   select '18', from: 'q_contains_date_3i' -      #   select 'juillet', from: 'q_contains_date_2i' -      #   select '2017', from: 'q_contains_date_1i' -      #   click_button 'filter_btn' -      #   expect(page).to have_content(july_calendar.short_name) -      #   expect(page).not_to have_content(calendars.first.short_name) -      # end -    end -  end - -  describe 'show' do -    it 'displays calendar' do -      visit calendar_path(calendars.first) -      expect(page).to have_content(calendars.first.name) -    end -  end - -  describe 'create', :wip do -    before do -      visit new_calendar_path - -    end -    it 'with correct date' do -      require 'pry' -      binding.pry - -    end - -  end -end | 
