Skip to content

Instantly share code, notes, and snippets.

@fernandolopes
Created April 13, 2011 00:32
Show Gist options
  • Select an option

  • Save fernandolopes/916744 to your computer and use it in GitHub Desktop.

Select an option

Save fernandolopes/916744 to your computer and use it in GitHub Desktop.
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