Skip to content

Instantly share code, notes, and snippets.

@aslakhellesoy
Forked from dchelimsky/example.rb
Created October 7, 2008 00:45
Show Gist options
  • Save aslakhellesoy/15198 to your computer and use it in GitHub Desktop.
Save aslakhellesoy/15198 to your computer and use it in GitHub Desktop.
describe "Given logged in, Homepage: url(:home)" do
before(:each) do
@rack = request(:home)
login
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 "Given anonymous, Homepage: url(:home)" 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