Created
June 7, 2011 01:41
-
-
Save anklos/1011513 to your computer and use it in GitHub Desktop.
rspec mock and stub
This file contains hidden or 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
server = mock_model(UI::Server) | |
server.stub!(:id).and_return(1) | |
server.stub!(:name).and_return('t1') | |
server.stub!(:ip_address).and_return('10.1.1.1') | |
server.stub!(:agent).and_return('Storage Cruiser') | |
UI::Server.stub!(:find_by_server_id).and_return(server) | |
get 'new' | |
response.should render_template('server_hbas/_new') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment