Created
December 7, 2010 12:16
-
-
Save dgwmfo/731732 to your computer and use it in GitHub Desktop.
Tests for my testimonials controller
This file contains hidden or 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::TestimonialsController do | |
integrate_views | |
describe "GET 'new'" do | |
before(:each) do | |
@user = Factory(:user) | |
end | |
describe "for non-signed-in users" do | |
it "should deny access" do | |
get 'new' | |
pending "redirect to login page" | |
pending "display flash notice asking user to log in" | |
end | |
end | |
describe "for signed-in users" do | |
before(:each) do | |
test_sign_in(@user) | |
end | |
describe "for non-admin users" do | |
it "should deny access" do | |
get 'new' | |
pending "redirect to previous page" | |
end | |
end | |
describe "for admin users" do | |
before(:each) do | |
pending "make user an admin" | |
end | |
it "should be successful" do | |
get 'new' | |
response.should be_success | |
end | |
it "should have the right title" do | |
get 'testimonials/new' | |
response.should have_tag("title", /Create New Testimonial/) | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment