-
-
Save JonCrawford/223330 to your computer and use it in GitHub Desktop.
This file contains 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
def index | |
@assets = current_account.assets.paginate :page => params[:page], :per_page => 10 | |
end | |
# How to spec this??? | |
before(:each) do | |
@account = Account.new | |
@assets = [Asset.new(:account => @account)] | |
end | |
it "should paginate the assets" | |
@controller.should_receive(:current_account).and_return(@account) | |
@account.should_receive(:assets).and_return(@assets) | |
@assets.should_receive(:paginate) | |
end |
This file contains 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
# controller action .. | |
def index | |
@tasks = Task.all | |
end | |
# spec .... | |
describe :get => :index do | |
expects :find, :on => Task, :with => :all, :returns => mock_task | |
should_assign_to :tasks, :with => mock_task | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment