Sha256: bfcbcc93fe52cbe7d9963fd62b1cf264730087702ec4ced68a5b963916c8711f

Contents?: true

Size: 940 Bytes

Versions: 7

Compression:

Stored size: 940 Bytes

Contents

require 'spec_helper'

describe 'MultiValueWithHelpInput', type: :input do
  subject { input_for file, field, { as: :multi_value_with_help, required: true } }
  let(:file) { GenericFile.new }

  context "when the field has a translation" do
    let(:field) { :language }
    it 'renders help icon' do
      expect(subject).to have_selector('a[rel=popover][data-original-title=Language]')
      expect(subject).to have_selector('a[rel=popover][data-content="The language of the file content."]')
      expect(subject).to have_selector('i.help-icon')
    end
  end

  context "when the field doesn't have a translation" do
    let(:field) { :date_modified }
    it 'renders help icon' do
      expect(subject).to have_selector('a[rel=popover][data-original-title="Date modified"]')
      expect(subject).to have_selector('a[rel=popover][data-content="Date modified"]')
      expect(subject).to have_selector('i.help-icon')
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sufia-6.2.0 spec/inputs/multi_value_with_help_input_spec.rb
sufia-6.1.0 spec/inputs/multi_value_with_help_input_spec.rb
sufia-6.0.0 spec/inputs/multi_value_with_help_input_spec.rb
sufia-6.0.0.rc4 spec/inputs/multi_value_with_help_input_spec.rb
sufia-6.0.0.rc3 spec/inputs/multi_value_with_help_input_spec.rb
sufia-6.0.0.rc2 spec/inputs/multi_value_with_help_input_spec.rb
sufia-6.0.0.rc1 spec/inputs/multi_value_with_help_input_spec.rb