Created
April 13, 2011 00:32
-
-
Save fernandolopes/916744 to your computer and use it in GitHub Desktop.
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
| require 'spec_helper' | |
| # This spec was generated by rspec-rails when you ran the scaffold generator. | |
| # It demonstrates how one might use RSpec to specify the controller code that | |
| # was generated by the Rails when you ran the scaffold generator. | |
| describe ObjetosController do | |
| login_usuario | |
| it "deveria listar os objetos no index" do | |
| objetos_mock = [mock_model(Objeto), mock_model(Objeto)] | |
| Objeto.should_receive(:all).and_return(objetos_mock) | |
| get 'index' | |
| response.should be_success | |
| assigns[:objetos].should == objetos_mock | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment