Skip to content

Instantly share code, notes, and snippets.

@dpmcnevin
Created September 6, 2010 23:45
Show Gist options
  • Save dpmcnevin/567649 to your computer and use it in GitHub Desktop.
Save dpmcnevin/567649 to your computer and use it in GitHub Desktop.
require 'test_helper'
class HostsControllerTest < ActionController::TestCase
context "Logged in as admin" do
setup do
@user = Factory.build(:admin_user) ## build, not create since it won't hit the database then
HostsController.any_instance.stubs(:current_user).returns(@user)
end
context "on INDEX action" do
setup do
get :index
end
should respond_with(:success)
should render_template(:index)
should respond_with_content_type(:html)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment