Permalink
Browse files

add test

  • Loading branch information...
eudoxa committed Apr 17, 2012
1 parent 71e5d6f commit f91b507b07fa10db7780032bfd39d9620bc7ea9b
Showing with 4 additions and 2 deletions.
  1. +4 −2 spec/lib/expand_spec.rb
View
@@ -99,13 +99,15 @@ def hello; 'hello'; end
it 'should use scope' do
expander.class_eval do
- scope :alice, lambda { |name| where(:name => name) }
+ scope :named, lambda { |name| where(:name => name) }
+ scope :alice, lambda { where(:name => 'alice') }
end
expander.attach(user_klass)
%w(alice bob).each { |name| User.create!(:name => name) }
user_klass.should have(2).records
- user_klass.ext(:prefix).alice('alice').should have(1).records
+ user_klass.ext(:prefix).named('alice').should have(1).records
+ user_klass.ext(:prefix).alice.should have(1).records
end
it 'should work with a block' do

0 comments on commit f91b507

Please sign in to comment.