require 'spec_helper' describe Banyan::BanyanSingleGroupModel do subject { FactoryGirl.create :banyan_single_group_model } it { should be_valid } its(:category_group) { should be_nil } context "with category group created" do let(:category_group) { FactoryGirl.create :banyan_category_group } before do subject.category_group = category_group subject.reload end its(:category_group) { should eq(category_group) } end end