Created
December 29, 2008 04:18
-
-
Save foca/41172 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
nil | |
"/" | |
"/" | |
"/login" | |
"/new" | |
"/integrity" | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'> | |
<head> | |
<meta content='text/html; charset=utf-8' http-equiv='Content-Type' /> | |
<meta content='en' http-equiv='Content-Language' /> | |
<title>integrity | integrity</title> | |
<link href='/reset.css' media='screen' rel='stylesheet' type='text/css' /> | |
<link href='/buttons.css' media='screen' rel='stylesheet' type='text/css' /> | |
<link href='/integrity.css' media='screen' rel='stylesheet' type='text/css' /> | |
<link href='/integrity.rss' rel='alternate' title='Build history RSS' type='application/rss+xml' /> | |
</head> | |
<body> | |
<div id='header'> | |
<h1><a href="/">projects</a> / integrity</h1> | |
<address class='watermark'> | |
checked with | |
<a href='http://integrityapp.com' title='The fun continuous integration server'>integrity</a> | |
</address> | |
</div> | |
<div id='content'> | |
<div id='administrative'> | |
<a href='/integrity/edit'>Edit Project</a> | |
</div> | |
<form action='/integrity/builds' class='blank_slate' method='post'> | |
<p>No builds for this project, buddy</p> | |
<h1> | |
You can request a | |
<button type='submit'>manual build</button> | |
</h1> | |
</form> | |
</div> | |
<div id='footer'> | |
Oh, hello | |
<strong>admin</strong> | |
</div> | |
</body> | |
</html> | |
F | |
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
module Webrat | |
class SinatraSession < RackSession #:nodoc: | |
include Sinatra::Test::Methods | |
attr_reader :request, :response | |
%w(get head post put delete).each do |verb| | |
define_method(verb) do |*args| # (path, data, headers = nil) | |
path, data, headers = *args | |
params = data.merge(:env => headers || {}) | |
self.__send__("#{verb}_it", path, params) | |
request_page(@response.location, :get, {}) while @response.redirect? | |
pp current_url | |
end | |
end | |
end | |
end | |
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
Project.first(:permalink => "integrity").should be_nil | |
login_as "admin", "test" | |
get "/new" | |
fill_in "Name", :with => "Integrity" | |
fill_in "Git repository", :with => "git://github.com/foca/integrity.git" | |
fill_in "Branch to track", :with => "master" | |
fill_in "Build script", :with => "rake" | |
check "Public project" | |
click_button "Create Project" | |
puts response_body | |
#debugger | |
current_url.should == "/integrity" | |
response_code.should == 200 | |
Project.first(:permalink => "integrity").should_not be_nil | |
log_out | |
get "/integrity" | |
current_url.should == "/integrity" | |
response_code.should == 200 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment