Sha256: 97a21e1f6f70c379f983fd29d7647929dff67b1d7fdf706ea1fab107ee8635c7
Contents?: true
Size: 746 Bytes
Versions: 22
Compression:
Stored size: 746 Bytes
Contents
require 'spec_helper' describe ApplicationController do describe "with a valid account id in the params" do before do @account = Factory(:account) @controller.stubs(:params).returns(:account_id => @account.to_param) end it "should return the corresponding account from current_account" do @controller.__send__(:current_account).should == @account end end describe "with an invalid account id in the params" do before do @controller.stubs(:params).returns(:account_id => "invalid") end it "should return the corresponding account from current_account" do expect { @controller.__send__(:current_account) }. to raise_error(ActiveRecord::RecordNotFound) end end end
Version data entries
22 entries across 22 versions & 1 rubygems