<commit_before>require File.join(File.dirname(__FILE__), 'spec_helper')

describe "InputCSS" do
  include ActionView::Helpers::TagHelper
  include ActionView::Helpers::FormTagHelper
  
  describe "ActionView::Helpers" do    
    describe "use examples shown in TagHelper#tag documentation" do
      # (http://www.noobkit.com/show/ruby/rails/rails-stable/actionpack/actionview/helpers/taghelper/tag.html)
      it "should not add a default class attribute to non-input tags" do
        tag('br').should eql("<br />")
        tag('br', nil, true).should eql("<br>")
        tag('img', {:src => 'open & shut.png'}).
          should eql("<img src=\"open &amp; shut.png\" />")
        tag('img', {:src => 'open &amp; shut.png'}, false, false).
          should eql("<img src=\"open &amp; shut.png\" />")
      end
    end
    <commit_msg>added specs to test different type attributes<commit_after>require File.join(File.dirname(__FILE__), 'spec_helper')

describe "InputCSS" do
  include ActionView::Helpers::TagHelper
  include ActionView::Helpers::FormTagHelper
  
  describe "tapping into the TagHelper#tag method" do
    it "should have class='text' for type='text'" do
      tag('input', {:type => 'text'}).
        should eql("<input class=\"text\" type=\"text\" />")
    end
    
    it "should have class='text' for type='password'" do
      tag('input', {:type => 'password'}).
        should eql("<input class=\"text\" type=\"password\" />")
    end
    
    it "should have class='submit' for type='submit'" do
      tag('input', {:type => 'submit'}).
        should eql("<input class=\"submit\" type=\"submit\" />")
    end
    
    it "should have class='reset' for type='reset'" do
      tag('input', {:type => 'reset'}).
        should eql("<input class=\"reset\" type=\"reset\" />")
    end
  end
  
  describe "ActionView::Helpers" do    
    describe "use examples shown in TagHelper#tag documentation" do
      # (http://www.noobkit.com/show/ruby/rails/rails-stable/actionpack/actionview/helpers/taghelper/tag.html)
      it "should not add a default class attribute to non-input tags" do
        tag('br').should eql("<br />")
        tag('br', nil, true).should eql("<br>")
        tag('img', {:src => 'open & shut.png'}).
          should eql("<img src=\"open &amp; shut.png\" />")
        tag('img', {:src => 'open &amp; shut.png'}, false, false).
          should eql("<img src=\"open &amp; shut.png\" />")
      end
    end
    
{'fraction_non_alphanumeric': 0.17680685994283382, 'fraction_numerical': 0.0, 'mean_word_length': 2.983739837398374, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4083497', 'n_tokens_mistral': 748, 'n_tokens_neox': 744, 'n_words': 200}