<commit_before># == Schema Information
# Schema version: 20100502225937
#
# Table name: ticket_kinds
#
#  id         :integer         not null, primary key
#  title      :string(255)
#  prefix     :string(255)
#  template   :text
#  created_at :datetime
#  updated_at :datetime
#  subject    :string(255)
#

require 'spec_helper'

describe TicketKind do
  before(:each) do
    @valid_attributes = {
      :title => "value for title",
      :prefix => "value for prefix",
      :template => "value for template"
    }
  end

  it "should create a new instance given valid attributes" do
    TicketKind.create!(@valid_attributes)
  end

  it "should set the prefix correctly" do
    Factory(:ticket_kind, :title => 'Volunteer').prefix.should == 'volunteer'
  end

  it "should not set prefix if no title is set" do
    kind = Factory.build(:ticket_kind, :title => nil, :prefix => nil)
    kind.should_not_receive(:prefix=)<commit_msg>Updated ticket_kind_spec to use :ticket_kind factory.<commit_after># == Schema Information
# Schema version: 20100502225937
#
# Table name: ticket_kinds
#
#  id         :integer         not null, primary key
#  title      :string(255)
#  prefix     :string(255)
#  template   :text
#  created_at :datetime
#  updated_at :datetime
#  subject    :string(255)
#

require 'spec_helper'

describe TicketKind do
  before(:each) do
    @valid_attributes = Factory.attributes_for :ticket_kind
  end

  it "should create a new instance given valid attributes" do
    TicketKind.create!(@valid_attributes)
  end

  it "should set the prefix correctly" do
    Factory(:ticket_kind, :title => 'Volunteer').prefix.should == 'volunteer'
  end

  it "should not set prefix if no title is set" do
    kind = Factory.build(:ticket_kind, :title => nil, :prefix => nil)
    kind.should_not_receive(:prefix=)
{'fraction_non_alphanumeric': 0.10604395604395604, 'fraction_numerical': 0.025274725274725275, 'mean_word_length': 3.5186104218362284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5193568', 'n_tokens_mistral': 612, 'n_tokens_neox': 562, 'n_words': 174}