Sha256: b0958dacc35288994c108cb3cd2f7b51047f86535fb82d48d90c5a380cc330d5

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../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

1 entries across 1 versions & 1 rubygems

Version Path
sufia-3.0.0 spec/helpers/generic_file_helper_spec.rb