Sha256: fcfc07f367c527803a6b1ab6b8a46ea41cd8252cc11a0d677f7d6b3d90f26932

Contents?: true

Size: 456 Bytes

Versions: 1

Compression:

Stored size: 456 Bytes

Contents

require "spec_helper"

describe Findable::Associations do
  include_context "AssociationModels"
  let(:group) { Group.first }
  let(:info) { Info.first }
  let(:tag) { Tag.first }

  describe "#has_many" do
    it { expect(group.tags.map(&:id).sort).to eq(Tag.all.map(&:id).sort) }
  end

  describe "#has_one" do
    it { expect(group.info.id).to eq(info.id) }
  end

  describe "#belongs_to" do
    it { expect(tag.group.id).to eq(group.id) }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
findable-0.1.1 spec/findable/associations_spec.rb