Sha256: 605d7b626a857d68fbb5899ebd74ea9d65825d8a1752c492e2419f75bd64c0b4
Contents?: true
Size: 1.36 KB
Versions: 30
Compression:
Stored size: 1.36 KB
Contents
require 'spec_helper' describe 'MultiValueWithHelpInput', type: :input do subject { input_for file, field, as: :multi_value_with_help, required: true } let(:file) { FileSet.new } context "when the field has a translation" do let(:field) { :language } before do allow_any_instance_of(MultiValueWithHelpInput).to receive(:raw_label_text).and_return('Language') allow_any_instance_of(MultiValueWithHelpInput).to receive(:translate_from_namespace).and_return('default translation') allow_any_instance_of(MultiValueWithHelpInput).to receive(:translate_from_namespace).with(:metadata_help).and_return( 'The language of the file content.' ) end it 'renders help icon' do expect(subject).to have_selector('a[data-toggle=popover][data-original-title=Language]') expect(subject).to have_selector('a[data-toggle=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[data-toggle=popover][data-original-title="Date modified"]') expect(subject).to have_selector('a[data-toggle=popover][data-content="Date modified"]') expect(subject).to have_selector('i.help-icon') end end end
Version data entries
30 entries across 30 versions & 1 rubygems