Sha256: 8f858525d32012a422a28e090227ae94c853c407be16044101ecfc00687bed42

Contents?: true

Size: 1.02 KB

Versions: 18

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'

describe GenericFileHelper do
  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

  it "draws help_icon" do
    str = String.new(helper.help_icon(:tag))
    doc = Nokogiri::HTML(str)
    a = doc.xpath('//a').first
    
    a.attr('data-content').should == "Words or phrases you select to describe what the file is about. These are used to search for content. <em>This is a required field</em>."
    a.attr('data-original-title').should == "Keyword"
    a.attr('id').should == "generic_file_tag_help"
    i = a.children.first
    i.attr('class').should == 'icon-question-sign icon-large'
  end

end


Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
sufia-3.7.2 spec/helpers/generic_file_helper_spec.rb
sufia-3.7.1 spec/helpers/generic_file_helper_spec.rb
sufia-3.7.0 spec/helpers/generic_file_helper_spec.rb
sufia-3.6.1 spec/helpers/generic_file_helper_spec.rb
sufia-3.6.0 spec/helpers/generic_file_helper_spec.rb
sufia-3.5.0 spec/helpers/generic_file_helper_spec.rb
sufia-3.4.0 spec/helpers/generic_file_helper_spec.rb
sufia-3.4.0.rc4 spec/helpers/generic_file_helper_spec.rb
sufia-3.4.0.rc3 spec/helpers/generic_file_helper_spec.rb
sufia-3.3.1 spec/helpers/generic_file_helper_spec.rb
sufia-3.4.0.rc2 spec/helpers/generic_file_helper_spec.rb
sufia-3.4.0.rc1 spec/helpers/generic_file_helper_spec.rb
sufia-3.3.0 spec/helpers/generic_file_helper_spec.rb
sufia-3.2.1 spec/helpers/generic_file_helper_spec.rb
sufia-3.1.3 spec/helpers/generic_file_helper_spec.rb
sufia-3.1.2 spec/helpers/generic_file_helper_spec.rb
sufia-3.1.1 spec/helpers/generic_file_helper_spec.rb
sufia-3.1.0 spec/helpers/generic_file_helper_spec.rb