Sha256: 90e1e4bde02f535cc86ef35247ca630aef5176ae8fd5ae1fd9e67be3200a4b60

Contents?: true

Size: 724 Bytes

Versions: 8

Compression:

Stored size: 724 Bytes

Contents

require 'spec_helper'

module Fooltip
  describe Association do
    it { should belong_to(:owner) }
    it { should belong_to(:container) }

    it { should validate_presence_of :owner_id }
    it { should validate_presence_of :owner_type }
    it { should validate_presence_of :container_id }

    it { should validate_uniqueness_of(:owner_id).scoped_to(:owner_type, :container_id) }

    context "an instance of an ActiveRecord class calling 'has_fooltips'" do
      let(:tf) { TestFooltip.new }
      it "should respond to :fooltips" do
        tf.should respond_to :fooltips
      end
      it "should not have any fooltips before any have been added" do
        tf.fooltips.should be_empty
      end
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fooltip-0.0.13 spec/models/fooltip/association_spec.rb
fooltip-0.0.12 spec/models/fooltip/association_spec.rb
fooltip-0.0.11 spec/models/fooltip/association_spec.rb
fooltip-0.0.10 spec/models/fooltip/association_spec.rb
fooltip-0.0.9 spec/models/fooltip/association_spec.rb
fooltip-0.0.8 spec/models/fooltip/association_spec.rb
fooltip-0.0.7 spec/models/fooltip/association_spec.rb
fooltip-0.0.6 spec/models/fooltip/association_spec.rb