Sha256: 9293c6cd1efe1c7d175905983e2b8318a67c9413e8c5865b1c38f661be09056f

Contents?: true

Size: 947 Bytes

Versions: 33

Compression:

Stored size: 947 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

feature 'saving a question which key clashes with its parent option', js: true do
  let(:questionnaire) { Quby.questionnaires.find('subquestion_key_clash') }
  scenario 'saving should have the value end up in the raw params and in the value itself' do

    answer = create_new_answer_for(questionnaire)
    visit_new_answer_for(questionnaire, 'paged', answer)
    choose 'answer_v_0_a1'
    fill_in 'answer[v_0_a1]', with: 'clashing'
    click_on 'Klaar'
    expect(page).to have_content("Bedankt voor het invullen van deze vragenlijst. Uw antwoorden zijn opgeslagen.")

    answer = Quby.send(:answer_repo).send(:all_records, 'subquestion_key_clash').last

    expect(answer.raw_params).to include(
      "aborted" => false,
      "v_0" => "a1",
      "v_0_a1" => "clashing"
    )
    expect(answer.value).to eq("v_0" => "a1",
                               'v_0_a1' => 'clashing')
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

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