Created
April 4, 2013 18:58
-
-
Save avit/5313135 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mock all calls through .find on an ActiveRecord model | |
# or its chained scopes | |
def expect_find(model) | |
@scope ||= model.scoped | |
model.stub!(:scoped).and_return @scope | |
@scope.should_receive(:find).ordered | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment