Skip to content

Instantly share code, notes, and snippets.

Created March 2, 2011 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/851302 to your computer and use it in GitHub Desktop.
Save anonymous/851302 to your computer and use it in GitHub Desktop.
require "spec_helper"
describe Admin::CoursesController do
let(:admin) { Fabricate(:admin) }
let(:course) { Fabricate(:course) }
before(:each) do
sign_in(admin)
end
describe "GET 'index'" do
it "should be successful" do
get "index"
response.should be_success
end
it "should display a list of courses" do
end
end
describe "POST 'create'" do
it "should create a new course, and redirect to index with a notice" do
Course.any_instance.stubs(:valid?).returns(true)
post 'create'
flash[:notice].should_not be_nil
response.should redirect_to(admin_courses_path)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment