Created
October 15, 2011 17:07
-
-
Save edipofederle/1289848 to your computer and use it in GitHub Desktop.
test.rb
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 mock_client(stubs={}) | |
@mock_client ||= mock_model(Client, stubs) | |
end | |
describe "GET index" do | |
it "should redirect to index page with clients obj" do | |
Client.stub(:find).with(:all, :order => "created_at desc").and_return([mock_client]) | |
get :index | |
response.should render_template("index") | |
assigns[:clients].should == [mock_client] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment