Sha256: 6964ffc825ca48f4518807d616766d333ae2ef7e9d252d16cb0164517f0e409f

Contents?: true

Size: 1001 Bytes

Versions: 32

Compression:

Stored size: 1001 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

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

  scenario 'saving a valid string' do
    fill_in_question 'v_string', 'kittens!'
    run_validations
    expect_no_errors
    expect_saved_value 'v_string', 'kittens!'
  end

  scenario 'saving without a string' do
    fill_in_question 'v_string', ''
    run_validations
    expect_error_on 'v_string', 'requires_answer'
  end
end

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

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

Version data entries

32 entries across 32 versions & 1 rubygems

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