Sha256: 145739611f6ee49105b20aa498499d07ecc1363084712c673b8add70e354d6c7

Contents?: true

Size: 1.03 KB

Versions: 32

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

shared_examples 'validations on textarea questions' do
  before do
    allow_server_side_validation_error
  end
  let(:questionnaire) do
    inject_questionnaire "test", <<-END
      question :v_textarea, type: :textarea, required: true do
        title "Enter a text"
      end; end_panel
    END
  end

  scenario 'saving a valid textarea' do
    fill_in_question 'v_textarea', "kittens!\nthey are cute"
    run_validations
    expect_no_errors
    expect_saved_value 'v_textarea', "kittens!\nthey are cute"
  end

  scenario 'saving without a textarea' do
    fill_in_question 'v_textarea', ''
    run_validations
    expect_error_on 'v_textarea', 'requires_answer'
  end
end

feature 'Client-side validations on textarea questions', js: true do
  include ClientSideValidationHelpers
  it_behaves_like "validations on textarea questions"
end

feature 'Server-side validations on textarea questions' do
  include ServerSideValidationHelpers
  it_behaves_like "validations on textarea questions"
end

Version data entries

32 entries across 32 versions & 1 rubygems

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