<commit_before>require 'spec_helper'

describe Deed do

  types = [ 'page_trans', 'page_edit', 'page_index', 'art_edit', 'note_add' ]

  before(:each) do
    @deed = FactoryGirl.create(:deed1)
  end

  # subject { @article }

  it { should belong_to(:article) } 
  it { should belong_to(:collection) }
  it { should belong_to(:note) }
  it { should belong_to(:page) }
  it { should belong_to(:user) } 
  it { should belong_to(:work) }

  it { should ensure_inclusion_of(:deed_type).in_array( types ) } 

  it 'tests short partial method' do
    deed = Deed.new
    deed.note = @note
    deed.page = @page
    deed.work = @work
    deed.collection = @collection
    # deed.deed_type = Deed::NOTE_ADDED
    deed.user = FactoryGirl.create(:user1)
    types.each do |type|
      deed.deed_type = type
      puts "Here is deed.short_partial: #{deed.short_partial}"
      puts "Here is deed.deed_type: #{deed.deed_type}"
      # puts "Here is deed::SHORT_PARTIALS[deed.deed_type]: #{Deed::SHORT_PARTIALS[deed.deed_type]}"
      puts "Here is deed::SHORT_PARTIALS[deed.deed_type]: #{Deed::SHORT_PARTIALS[type]}"
      # puts "Here is deed::SHORT_PARTIALS[deed.deed_type]: #{Deed::SHORT_PARTIALS}"
      deed.short_partial.should == Deed::SHORT_PARTIALS[type]
    end
    # @deed.short_partial.should == 'deed/' + @deed.deed_type + '_short.html.erb'
  end

end<commit_msg>I have a test for deed.long_partials, with a lot of comments taken out<commit_after>require 'spec_helper'

describe Deed do

  types = [ 'page_trans', 'page_edit', 'page_index', 'art_edit', 'note_add' ]

  before(:each) do
    @deed = FactoryGirl.create(:deed1)
  end

  # subject { @article }

  it { should belong_to(:article) } 
  it { should belong_to(:collection) }
  it { should belong_to(:note) }
  it { should belong_to(:page) }
  it { should belong_to(:user) } 
  it { should belong_to(:work) }

  it { should ensure_inclusion_of(:deed_type).in_array( types ) } 

  it 'tests short and long partials methods' do
    deed = Deed.new
    deed.note = @note
    deed.page = @page
    deed.work = @work
    deed.collection = @collection
    deed.user = FactoryGirl.create(:user1)
    types.each do |type|
      deed.deed_type = type
      deed.short_partial.should == Deed::SHORT_PARTIALS[type]
      # is there a better way to test long_partials?
      if type == 'note_add'
        deed.long_partial.should == Deed::LONG_PARTIALS[type]
      else
        deed.long_partial.should == Deed::SHORT_PARTIALS[type]
      end
    end
  end

  

end
{'fraction_non_alphanumeric': 0.12898089171974522, 'fraction_numerical': 0.0015923566878980893, 'mean_word_length': 3.432098765432099, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3794760', 'n_tokens_mistral': 957, 'n_tokens_neox': 864, 'n_words': 197}