Sha256: efbc03e21b2125718a444f2b660aebbab774718797d59da7f596fe8a0fe4bef5

Contents?: true

Size: 668 Bytes

Versions: 3

Compression:

Stored size: 668 Bytes

Contents

require 'spec_helper'

describe TransactionsController do

  def mock_transaction(stubs={})
    @mock_transaction ||= mock_model(Transaction, stubs)
  end
  
  describe "GET index" do
    it "assigns all transactions as @transactions" do
      Transaction.stub(:find).with(:all).and_return([mock_transaction])
      get :index
      assigns[:transactions].should == [mock_transaction]
    end
  end
  
  describe "GET show" do
    it "assigns the requested transaction as @transaction" do
      Transaction.stub(:find).with("37").and_return(mock_transaction)
      get :show, :id => "37"
      assigns[:transaction].should equal(mock_transaction)
    end
  end  

end

Version data entries

3 entries across 3 versions & 1 rubygems

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