<commit_before>require 'spec_helper'

describe Invoice do
  it { should belong_to(:customer) }
  it { should belong_to(:company) }

  it { should validate_presence_of(:customer) }
  it { should validate_presence_of(:company) }
  it { should validate_presence_of(:title) }
  it { should validate_presence_of(:state) }

  context "when new" do
    specify { should_not be_valid }

    its(:to_s) { should == "" }
  end

  context "when amount is nil" do
    before(:all) { subject.amount = nil }

    its(:to_s) { should == "" }
  end

  context "when properly initialized" do
    subject { Factory.build :invoice }

    its(:to_s) { should =~ /New Invoice/ }
  end

  context "with bookings" do
    it { should have_many(:bookings) }
  end
end<commit_msg>Remove the setter of amount cause is now obsolete.<commit_after>require 'spec_helper'

describe Invoice do
  it { should belong_to(:customer) }
  it { should belong_to(:company) }

  it { should validate_presence_of(:customer) }
  it { should validate_presence_of(:company) }
  it { should validate_presence_of(:title) }
  it { should validate_presence_of(:state) }

  context "when new" do
    specify { should_not be_valid }

    its(:to_s) { should == "" }
  end

  context "when amount is nil" do
    its(:to_s) { should == "" }
  end

  context "when properly initialized" do
    subject { Factory.build :invoice }

    its(:to_s) { should =~ /New Invoice/ }
  end

  context "with bookings" do
    it { should have_many(:bookings) }
  end
end
{'fraction_non_alphanumeric': 0.11318242343541944, 'fraction_numerical': 0.0, 'mean_word_length': 3.5271084337349397, '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': '5601174', 'n_tokens_mistral': 507, 'n_tokens_neox': 486, 'n_words': 138}