Sha256: ef502f444b90ef5089af0217281d69246aa798b3bf5c73f220e6e0b12b139c3d

Contents?: true

Size: 747 Bytes

Versions: 2

Compression:

Stored size: 747 Bytes

Contents

require 'spec_helper'

describe Banyan::BanyanGroupModel do
  subject { FactoryGirl.create :banyan_group_model }

  it                    { should be_valid }
  its(:category_groups) { should be_an(Array) }
  its(:category_groups) { should be_empty }

  context "with category group created" do
    let(:category_group) { FactoryGirl.create :banyan_category_group }
    before do
      subject.category_groups << category_group
      subject.reload
    end

    it "should return only one instance of a category group" do
      subject.category_groups << category_group
      subject.category_groups << category_group
      subject.category_groups.should have(1).item
    end

    its(:category_groups) { should include(category_group) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
banyan-1.1.1 spec/banyan/banyan_group_model_spec.rb
banyan-1.0.1 spec/banyan/banyan_group_model_spec.rb