Skip to content

Instantly share code, notes, and snippets.

@russ
Forked from anonymous/gist:851302
Created March 2, 2011 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save russ/851312 to your computer and use it in GitHub Desktop.
Save russ/851312 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
before(:each) do
get "index"
end
it { should respond_with(:success) }
end
describe "POST 'create'" do
before(:each) do
post 'create', { :course => Fabricate.attributes_for(:course) }
end
it { should set_the_flash_to("Course Saved!") }
it { should respond_with(:redirect) }
it { should redirect_to("admin courses path") { admin_courses_path } }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment