How can i have rspec test for my default scope

Viewed 8930

my model has default_scope(:order => 'created_at' ) my tests (rspec, factory girl, shoulda, etc.) are:

require 'spec/spec_helper.rb'

describe CatMembership do
  context "is valid" do
    subject { Factory.build(:cat_membership) }
    it { should be_valid }
    it { should belong_to :cat}
    it { should belong_to :cat_group}
    it { should have_db_column(:start_date)}
    it { should have_db_column(:end_date)}
  end
end
3 Answers
Related