> So it looks likehave_scopeand have_default_scope both don't work.
> Is there a solution to this? Thanks.
> On Jan 14, 7:04 pm, ericindc <ericmilf...@gmail.com> wrote:
> > I'm not sure how to gethave_scopepassing. I'm on Rails 3.0.3 with
> > using the alpha4 version of remarkable_activerecord. According to the
> > docs, what I have should work.
> > Failure/Error: it { shouldhave_scope(:latest).limit(3) }
> > Expected :latest when called on Post scope to SELECT "posts".*
> > FROM "posts" WHERE (published_at is not null) ORDER BY published_at
> > desc LIMIT 3, got SELECT "posts".* FROM "posts" WHERE (published_at is
> > not null) ORDER BY published_at desc LIMIT 3
> > class Post < ActiveRecord::Base
> > has_many :comments
> > scope :latest, limit(3)
> > default_scope where('published_at is not null').order('published_at
> > desc')
> > end
> > require 'spec_helper'
> > describe Post do
> > it { should have_many(:comments) }
> > # Commented out because this breaks with an error about an array
> > index. Any ideas?
> > #
> > #it { should have_default_scope.where('published_at is not
> > null').order('published_at desc') }
> > it { shouldhave_scope(:latest).limit(3) }
> > end