Sha256: 4e381714e8ad5f1e18d99c9c6990661e8a729f5a2f6cf9e12b3f2cddef5fc71d

Contents?: true

Size: 867 Bytes

Versions: 6

Compression:

Stored size: 867 Bytes

Contents

require 'spec_helper'

describe RecordsHelper do
  it "should have object_type_options" do
    HydraEditor.models = ['Audio', 'Pdf']
    I18n.stub(:t).with("hydra.model_label.Audio", default: 'Audio').and_return('Audio')
    I18n.stub(:t).with("hydra.model_label.Pdf", default: 'Pdf').and_return('PDF')
    helper.object_type_options.should == {'Audio' => 'Audio', 'PDF' => 'Pdf'}
  end

  it "draws add button" do
    helper.add_field(:test).should == 
      "<button class=\"adder btn\" id=\"additional_test_submit\" name=\"additional_test\">+<span class=\"accessible-hidden\">add another test</span></button>"
  end

  it "draws subtract button" do
    helper.subtract_field(:test).should == 
      "<button class=\"remover btn\" id=\"additional_test_submit\" name=\"additional_test\">-<span class=\"accessible-hidden\">add another test</span></button>"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hydra-editor-0.0.6 spec/helpers/records_helper_spec.rb
hydra-editor-0.0.5 spec/helpers/records_helper_spec.rb
hydra-editor-0.0.4 spec/helpers/records_helper_spec.rb
hydra-editor-0.0.3 spec/helpers/records_helper_spec.rb
hydra-editor-0.0.2 spec/helpers/records_helper_spec.rb
hydra-editor-0.0.1 spec/helpers/records_helper_spec.rb