Sha256: daa8afa524de19aca30c8aa5aef1d6cf3bf915bd07280dcd71bc7d145f23c86c

Contents?: true

Size: 1.1 KB

Versions: 33

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

feature 'Deselecting questions' do
  let(:questionnaire) do
    inject_questionnaire("test", <<-END)
        panel do
        question :v1, type: :radio, required: true, deselectable: false do
          option :a1, value: 1, description: "Ja"
          option :a2, value: 2, description: "Nee"
        end;

        question :v2, type: :radio, required: true do
          option :a1, value: 1, description: "Ja"
          option :a2, value: 2, description: "Nee"
        end;
        end; end_panel
    END
  end

  scenario 'disables deselecting for deselectable: false questions', js: true do
    visit_new_answer_for(questionnaire)
    choose "answer_v1_a1"
    expect(page).to have_checked_field("answer_v1_a1")
    choose "answer_v1_a1"
    expect(page).to have_checked_field("answer_v1_a1")
  end

  scenario 'enables deselecting by default', js: true do
    visit_new_answer_for(questionnaire)
    choose "answer_v2_a1"
    expect(page).to have_checked_field("answer_v2_a1")
    choose "answer_v2_a1"
    expect(page).to_not have_checked_field("answer_v2_a1")
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

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