Sha256: 7356bef3a5823ce1322d56cde18de00c19fa5a1cf62b05abf26bd4cb4a01c233

Contents?: true

Size: 1.58 KB

Versions: 33

Compression:

Stored size: 1.58 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

feature 'Switching to bulk view' do
  let(:panels) do
    <<-END
      panel do
        text 'This will not appear in bulk'

        question :v1, type: :radio do
          option :a1, value: 1, description: "Ja"
          option :a2, value: 2, description: "Nee"
        end
      end

      panel do
        question :v2, type: :radio do
          option :a1, value: 1, description: "Ja"
          option :a2, value: 2, description: "Nee"
        end
      end

      end_panel
    END
  end

  let(:allow_switch_questionnaire) do
    inject_questionnaire("test", <<-END)
      allow_switch_to_bulk
      #{panels}
    END
  end

  let(:disallow_switch_questionnaire) do
    inject_questionnaire("test", <<-END)
      allow_switch_to_bulk false
      #{panels}
    END
  end

  scenario 'switch to bulk view', js: true do
    visit_new_answer_for(allow_switch_questionnaire)
    expect(page).to have_content('This will not appear in bulk')
    click_link "Bulk-weergave"
    expect(page).not_to have_content('This will not appear in bulk')
  end

  scenario 'switch only appears on the first page', js: true do
    visit_new_answer_for(allow_switch_questionnaire)
    expect(page).to have_content('This will not appear in bulk')
    click_on 'Verder'
    expect(page).not_to have_content('Bulk-weergave')
  end

  scenario 'disallowed switching to bulk view', js: true do
    visit_new_answer_for(disallow_switch_questionnaire)
    expect(page).to have_content('This will not appear in bulk')
    expect(page).not_to have_content('Bulk-weergave')
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
quby-5.6.5 spec/features/allow_switching_to_bulk_spec.rb
quby-5.6.3 spec/features/allow_switching_to_bulk_spec.rb
quby-5.6.2 spec/features/allow_switching_to_bulk_spec.rb
quby-5.6.1 spec/features/allow_switching_to_bulk_spec.rb
quby-5.6.0 spec/features/allow_switching_to_bulk_spec.rb
quby-5.5.0 spec/features/allow_switching_to_bulk_spec.rb
quby-5.4.0 spec/features/allow_switching_to_bulk_spec.rb
quby-5.3.1 spec/features/allow_switching_to_bulk_spec.rb
quby-5.3.0 spec/features/allow_switching_to_bulk_spec.rb
quby-5.2.0 spec/features/allow_switching_to_bulk_spec.rb
quby-5.1.3 spec/features/allow_switching_to_bulk_spec.rb
quby-5.1.2 spec/features/allow_switching_to_bulk_spec.rb
quby-5.1.1 spec/features/allow_switching_to_bulk_spec.rb
quby-5.1.0 spec/features/allow_switching_to_bulk_spec.rb
quby-5.0.5 spec/features/allow_switching_to_bulk_spec.rb
quby-5.0.4 spec/features/allow_switching_to_bulk_spec.rb
quby-5.0.3 spec/features/allow_switching_to_bulk_spec.rb
quby-5.0.2 spec/features/allow_switching_to_bulk_spec.rb
quby-5.0.1 spec/features/allow_switching_to_bulk_spec.rb
quby-5.0.0 spec/features/allow_switching_to_bulk_spec.rb