Sha256: 69b040ab5895a064f23eed6a275a9a753a46cb57ef4c9f84a482dcdf17320c21

Contents?: true

Size: 600 Bytes

Versions: 3

Compression:

Stored size: 600 Bytes

Contents

require 'spec_helper'

describe AccountsController do

  def mock_account(stubs={})
    @mock_account ||= mock_model(Account, stubs)
  end
  
  describe "GET index" do
    it "assigns all accounts as @accounts" do
      Account.stub(:find).with(:all).and_return([mock_account])
      get :index
      assigns[:accounts].should == [mock_account]
    end
  end

  describe "GET show" do
    it "assigns the requested account as @account" do
      Account.stub(:find).with("37").and_return(mock_account)
      get :show, :id => "37"
      assigns[:account].should equal(mock_account)
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
plutus-0.5.2 spec/controllers/accounts_controller_spec.rb
plutus-0.5.1 spec/controllers/accounts_controller_spec.rb
plutus-0.4.2 spec/controllers/accounts_controller_spec.rb