Sha256: 45b0b5b68acc61903dfb912af8ddd1b9509dac47700acf3915ce3e89bd0dcb78

Contents?: true

Size: 739 Bytes

Versions: 5

Compression:

Stored size: 739 Bytes

Contents

require 'test_helper'

module FinePrint
  describe Signature do
    it 'can''t be associated with unpublished contracts' do
      contract = FactoryGirl.create(:contract)
      expect(contract.is_published?).to be_false
      expect(contract.can_be_updated?).to be_true

      sig = FactoryGirl.build(:signature)
      sig.contract = contract
      expect(sig.save).to be_false

      contract.reload
      expect(contract.can_be_updated?).to be_true
    end

    it 'prevents contract from being updated' do
      sig = FactoryGirl.build(:signature)
      contract = sig.contract
      expect(contract.can_be_updated?).to be_true

      sig.save!
      contract.reload
      expect(contract.can_be_updated?).to be_false
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fine_print-1.3.0 spec/models/signature_spec.rb~
fine_print-1.2.0 spec/models/signature_spec.rb~
fine_print-1.1.1 spec/models/signature_spec.rb~
fine_print-1.1.0 spec/models/signature_spec.rb~
fine_print-1.0.0 spec/models/signature_spec.rb~