Skip to content

Instantly share code, notes, and snippets.

@dchelimsky
Forked from wycats/example.rb
Created October 3, 2008 22:35
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 dchelimsky/14670 to your computer and use it in GitHub Desktop.
Save dchelimsky/14670 to your computer and use it in GitHub Desktop.
given "logged in" do
login
end
given "anonymous" do end
describe "Homepage: url(:home)", :given => "logged in" do
before(:each) do
@rack = request(:home)
end
it "allows the user to visit" do
@rack.should be_successful
@rack.body.should == "Welcome"
end
it "returns an HTML page" do
@rack.should have_content_type(:html)
end
end
describe "Homepage: url(:home)", :given => "anonymous" do
it "redirects the user to the login screen" do
requesting(:home).should redirect_to(:get_login)
end
end
Given logged in, Homepage: url(:home) allows the user to visit
Given logged in, Homepage: url(:home) returns an HTML page
Given anonymous, Homepage: url(:home) redirects the user to the login screen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment