Created
March 2, 2011 17:16
-
-
Save anonymous/851302 to your computer and use it in GitHub Desktop.
This file contains 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" | |
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