Sha256: 31069b812eb2caeaef340f5014bbd4dc625f26f658a1b2752045b42c0798a883

Contents?: true

Size: 714 Bytes

Versions: 13

Compression:

Stored size: 714 Bytes

Contents

require 'spec_helper'

describe 'SelectWithModalHelpInput', type: :input do
  subject { input_for file, :rights, options }
  let(:file) { GenericFile.new }
  let(:base_options) { { as: :select_with_modal_help, required: true, collection: Sufia.config.cc_licenses } }
  let(:options) { base_options }

  context "when a blank is requested" do
    let(:options) { base_options.merge(include_blank: true) }
    it 'renders a blank option' do
      expect(subject).to have_selector 'select option[value=""]'
    end
  end

  context "when a blank is not requested" do
    it 'has no blanks' do
      expect(subject).to have_selector 'select option:first-child', text: 'Attribution 3.0 United States'
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sufia-6.7.0 spec/inputs/select_with_modal_help_input_spec.rb
sufia-6.6.1 spec/inputs/select_with_modal_help_input_spec.rb
sufia-6.6.0 spec/inputs/select_with_modal_help_input_spec.rb
sufia-6.5.0 spec/inputs/select_with_modal_help_input_spec.rb
sufia-6.4.0 spec/inputs/select_with_modal_help_input_spec.rb
sufia-6.3.0 spec/inputs/select_with_modal_help_input_spec.rb
sufia-6.2.0 spec/inputs/select_with_modal_help_input_spec.rb
sufia-6.1.0 spec/inputs/select_with_modal_help_input_spec.rb
sufia-6.0.0 spec/inputs/select_with_modal_help_input_spec.rb
sufia-6.0.0.rc4 spec/inputs/select_with_modal_help_input_spec.rb
sufia-6.0.0.rc3 spec/inputs/select_with_modal_help_input_spec.rb
sufia-6.0.0.rc2 spec/inputs/select_with_modal_help_input_spec.rb
sufia-6.0.0.rc1 spec/inputs/select_with_modal_help_input_spec.rb