Created
October 27, 2008 01:48
-
-
Save moro/19995 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
$KCODE = 'u' | |
require 'rubygems' | |
require 'hpricot' | |
require 'thin' | |
require 'rack' | |
describe "My Rails App" do | |
module Requests | |
def get(path) | |
Rack::MockRequest.new(@app).get(path) | |
end | |
end | |
include Requests | |
before(:all) do | |
@app = Rack::Adapter::Rails.new(:environment => "development") | |
end | |
describe "GET /" do | |
before do | |
@res = get("/") | |
end | |
it "body should have link to /login" do | |
Hpricot(@res.body).search("a[@href=/login]").should_not be_empty | |
end | |
it "@res.header.should include(Set-Cookie)" do | |
@res.headers.should include("Set-Cookie") | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment