-
-
Save russ/851312 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 | |
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