Sha256: 20acdeb6e97aaacae9f18a74be9b1e324f07ff82a51388c442b3b371ecfee9c2

Contents?: true

Size: 1.34 KB

Versions: 33

Compression:

Stored size: 1.34 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

module Quby
  describe "quby/answers/paged/panel" do
    let(:questionnaire) { inject_questionnaire("panels", <<-END) }
      title "Questionnaire with a bunch of panels"

      panel do
        text "First panel"
      end

      panel do
        text "Second panel"
      end

      panel do
        text "Third panel"
      end
    END

    it 'renders progress bar for paged questionnaires with more than one panel' do
      visit_new_answer_for(questionnaire)
      @questionnaire = questionnaire
      expect(page).to have_selector(".step-1")
      expect(page).to have_selector(".step-3")
    end

    it 'shows the user is on the next page' do
      visit_new_answer_for(questionnaire)
      @questionnaire = questionnaire

      expect(page).to have_selector("#panel0 .step-1.active")
      expect(page).to have_no_selector("#panel0 .step-2.active")
      expect(page).to have_no_selector("#panel0 .step-3.active")

      expect(page).to have_selector("#panel1 .step-1.active")
      expect(page).to have_selector("#panel1 .step-2.active")
      expect(page).to have_no_selector("#panel1 .step-3.active")

      expect(page).to have_selector("#panel2 .step-1.active")
      expect(page).to have_selector("#panel2 .step-2.active")
      expect(page).to have_selector("#panel2 .step-3.active")
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

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