Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove backup, preserve playground

  • Loading branch information...
commit 30455166436874a00ed26f77cf5da0e21f79fe4d 1 parent 9a97aea
@svenfuchs authored
Showing with 19 additions and 14,878 deletions.
  1. +0 −28 _backup/app/contollers/test/sessions_controller.rb
  2. +0 −5 _backup/config/routes.rb
  3. +0 −62 _backup/lib/steam/rails/reloader.rb
  4. +0 −30 _backup/lib/steam/rails/test_case.rb
  5. +0 −3  _backup/test/all.rb
  6. +0 −5 _backup/test/features/steam.feature
  7. +0 −8 _backup/test/features/step_definitions/steam_steps.rb
  8. +0 −133 _backup/test/features/step_definitions/webrat_steps.rb
  9. +0 −30 _backup/test/features/support/env.rb
  10. 0  _backup/test/features/support/hooks.rb
  11. +0 −15 _backup/test/features/support/paths.rb
  12. +0 −17 _backup/test/features/support/responses.rb
  13. +0 −327 _backup/test/fixtures/page.html
  14. BIN  _backup/test/fixtures/rails.png
  15. +0 −10 _backup/test/fixtures/rails/Rakefile
  16. +0 −2  _backup/test/fixtures/rails/app/controllers/application_controller.rb
  17. +0 −18 _backup/test/fixtures/rails/app/controllers/users_controller.rb
  18. +0 −3  _backup/test/fixtures/rails/app/models/user.rb
  19. +0 −25 _backup/test/fixtures/rails/app/views/layouts/application.html.erb
  20. +0 −6 _backup/test/fixtures/rails/app/views/users/index.html.erb
  21. +0 −2  _backup/test/fixtures/rails/app/views/users/show.html.erb
  22. +0 −110 _backup/test/fixtures/rails/config/boot.rb
  23. +0 −22 _backup/test/fixtures/rails/config/database.yml
  24. +0 −41 _backup/test/fixtures/rails/config/environment.rb
  25. +0 −17 _backup/test/fixtures/rails/config/environments/development.rb
  26. +0 −28 _backup/test/fixtures/rails/config/environments/production.rb
  27. +0 −28 _backup/test/fixtures/rails/config/environments/test.rb
  28. +0 −7 _backup/test/fixtures/rails/config/initializers/backtrace_silencers.rb
  29. +0 −10 _backup/test/fixtures/rails/config/initializers/inflections.rb
  30. +0 −5 _backup/test/fixtures/rails/config/initializers/mime_types.rb
  31. +0 −21 _backup/test/fixtures/rails/config/initializers/new_rails_defaults.rb
  32. +0 −15 _backup/test/fixtures/rails/config/initializers/session_store.rb
  33. +0 −5 _backup/test/fixtures/rails/config/locales/en.yml
  34. +0 −3  _backup/test/fixtures/rails/config/routes.rb
  35. BIN  _backup/test/fixtures/rails/db/development.sqlite3
  36. +0 −12 _backup/test/fixtures/rails/db/migrate/20090926101010_create_users.rb
  37. +0 −20 _backup/test/fixtures/rails/db/schema.rb
  38. BIN  _backup/test/fixtures/rails/db/test.sqlite3
  39. BIN  _backup/test/fixtures/rails/public/images/rails.png
  40. +0 −8 _backup/test/fixtures/rails/public/javascripts/ajax_call.js
  41. +0 −3  _backup/test/fixtures/rails/public/javascripts/application.js
  42. +0 −9,137 _backup/test/fixtures/rails/public/javascripts/jquery-ui.js
  43. +0 −4,376 _backup/test/fixtures/rails/public/javascripts/jquery.js
  44. +0 −3  _backup/test/fixtures/rails/public/stylesheets/application.css
  45. +0 −32 _backup/test/playground/drb/daemonized_client.rb
  46. +0 −56 _backup/test/playground/drb/daemons.rb
  47. +0 −22 _backup/test/playground/drb/forker.rb
  48. +0 −10 _backup/test/playground/drb/server.rb
  49. +0 −154 _backup/test/test_helper.rb
  50. +16 −0 lib/steam/browser.rb
  51. 0  {_backup → }/test/playground/connection.rb
  52. +3 −4 test/playground/drb.rb
  53. 0  {_backup → }/test/playground/java_signature.rb
  54. 0  {_backup → }/test/playground/nokogiri.rb
  55. 0  {_backup → }/test/playground/put_headers.rb
  56. 0  {_backup → }/test/playground/rack.rb
  57. 0  {_backup → }/test/playground/rjb_bind.rb
  58. 0  {_backup → }/test/playground/stack_level_problem.rb
  59. 0  {_backup → }/test/playground/thread_problem.rb
  60. 0  {_backup → }/test/playground/web_response_data.rb
  61. 0  {_backup → }/test/playground/webrat.rb
  62. 0  {_backup → }/test/playground/xhr_accept_headers.rb
View
28 _backup/app/contollers/test/sessions_controller.rb
@@ -1,28 +0,0 @@
-class Test::SessionsController < ApplicationController
- def index
- render :text => 'sessions'
- end
-
- def create
- reset_database!
- render :text => '123455', :status => 201 # TODO how to return the session id?
- end
-
- def destroy
- render :text => 'OK'
- end
-
- def reset_database!
- # request.env['rack.test.db_reset'] = 'dump' # TODO move to client
-
- case request.env['rack.test.db_reset']
- when 'dump'
- `mysql -u root env_test < #{Rails.root}/db/dumps/env_test.dump.sql`
- else
- ActiveRecord::Migration.suppress_messages do
- load("#{Rails.root}/db/schema.rb")
- end
- load("#{Rails.root}/test/fixtures.rb")
- end
- end
-end
View
5 _backup/config/routes.rb
@@ -1,5 +0,0 @@
-ActionController::Routing::Routes.draw do |map|
- map.namespace :test do |test|
- test.resources :sessions
- end
-end
View
62 _backup/lib/steam/rails/reloader.rb
@@ -1,62 +0,0 @@
-require 'thread'
-
-module Steam
- module Rails
- class Reloader
- @@lock = Mutex.new
- cattr_accessor :default_lock
-
- class BodyWrapper
- def initialize(body, lock, cleanup)
- @body = body
- @lock = lock
- @cleanup = cleanup
- end
-
- def close
- @body.close if @body.respond_to?(:close)
- ensure
- Dispatcher.cleanup_application if @cleanup
- @lock.unlock
- end
-
- def method_missing(*args, &block)
- @body.send(*args, &block)
- end
-
- def respond_to?(symbol, include_private = false)
- symbol == :close || @body.respond_to?(symbol, include_private)
- end
- end
-
- def initialize(app)
- @app = app
- end
-
- def call(env)
- rewrite_test_env!(env)
-
- begin
- @@lock.lock
- Dispatcher.reload_application unless env.has_key?('rack.test.cache_classes')
- # gotta call build_middleware_stack if reloading
- status, headers, body = @app.call(env)
- [status, headers, BodyWrapper.new(body, @@lock, !env.has_key?('rack.test.cache_classes'))]
- rescue Exception
- @@lock.unlock
- raise
- end
- end
-
- protected
-
- def rewrite_test_env!(env)
- env.keys.each do |key|
- if key.include?('HTTP_RACK.TEST')
- env[key.downcase.sub(/^http_/, '')] = env.delete(key)
- end
- end
- end
- end
- end
-end
View
30 _backup/lib/steam/rails/test_case.rb
@@ -1,30 +0,0 @@
-# require 'active_support/test_case'
-# require 'steam/session'
-#
-# module Steam
-# module Rails
-# class TestCase < ActiveSupport::TestCase
-# attr_reader :session
-# delegate :browser, :request, :response, :headers, :session, :get, :post, :put, :delete, :head, :to => :@session
-# delegate :status, :to => :response
-#
-# setup do |test|
-# test.init
-# end
-#
-# teardown do |test|
-# test.reset!
-# end
-#
-# def init
-# browser = Steam::Browser::HtmlUnit.new
-# @session = Steam::Session.new(browser)
-# end
-#
-# def reset!
-# @session.stop
-# @session = nil
-# end
-# end
-# end
-# end
View
3  _backup/test/all.rb
@@ -1,3 +0,0 @@
-Dir[File.dirname(__FILE__) + '/**/*_test.rb'].each do |filename|
- require filename
-end
View
5 _backup/test/features/steam.feature
@@ -1,5 +0,0 @@
-Feature: Steam
- Scenario: Cucumber integration
- When I go to the users index page
- Then I should see a list of users
- And jquery should have set the document title to "FOO"
View
8 _backup/test/features/step_definitions/steam_steps.rb
@@ -1,8 +0,0 @@
-Then /^I should see a list of users$/ do
- # FIXME! implement webrat matchers
- response.body.join.should match(/id="users"/)
-end
-
-Then /^jquery should have set the document title to "([^\"]*)"$/ do |value|
- response.body.join.should match(/<title>\s*#{value}\s*<\/title>/)
-end
View
133 _backup/test/features/step_definitions/webrat_steps.rb
@@ -1,133 +0,0 @@
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
-
-# Commonly used webrat steps
-# http://github.com/brynary/webrat
-
-Given /^I am on (.+)$/ do |page_name|
- visit path_to(page_name)
-end
-
-When /^I go to (.+)$/ do |page_name|
- visit path_to(page_name)
-end
-
-When /^I press "([^\"]*)"$/ do |button|
- click_button(button)
-end
-
-When /^I follow "([^\"]*)"$/ do |link|
- click_link(link)
-end
-
-When /^I follow "([^\"]*)" within "([^\"]*)"$/ do |link, parent|
- click_link_within(parent, link)
-end
-
-When /^I fill in "([^\"]*)" with "([^\"]*)"$/ do |field, value|
- fill_in(field, :with => value)
-end
-
-When /^I select "([^\"]*)" from "([^\"]*)"$/ do |value, field|
- select(value, :from => field)
-end
-
-# Use this step in conjunction with Rail's datetime_select helper. For example:
-# When I select "December 25, 2008 10:00" as the date and time
-When /^I select "([^\"]*)" as the date and time$/ do |time|
- select_datetime(time)
-end
-
-# Use this step when using multiple datetime_select helpers on a page or
-# you want to specify which datetime to select. Given the following view:
-# <%= f.label :preferred %><br />
-# <%= f.datetime_select :preferred %>
-# <%= f.label :alternative %><br />
-# <%= f.datetime_select :alternative %>
-# The following steps would fill out the form:
-# When I select "November 23, 2004 11:20" as the "Preferred" date and time
-# And I select "November 25, 2004 10:30" as the "Alternative" date and time
-When /^I select "([^\"]*)" as the "([^\"]*)" date and time$/ do |datetime, datetime_label|
- select_datetime(datetime, :from => datetime_label)
-end
-
-# Use this step in conjunction with Rail's time_select helper. For example:
-# When I select "2:20PM" as the time
-# Note: Rail's default time helper provides 24-hour time-- not 12 hour time. Webrat
-# will convert the 2:20PM to 14:20 and then select it.
-When /^I select "([^\"]*)" as the time$/ do |time|
- select_time(time)
-end
-
-# Use this step when using multiple time_select helpers on a page or you want to
-# specify the name of the time on the form. For example:
-# When I select "7:30AM" as the "Gym" time
-When /^I select "([^\"]*)" as the "([^\"]*)" time$/ do |time, time_label|
- select_time(time, :from => time_label)
-end
-
-# Use this step in conjunction with Rail's date_select helper. For example:
-# When I select "February 20, 1981" as the date
-When /^I select "([^\"]*)" as the date$/ do |date|
- select_date(date)
-end
-
-# Use this step when using multiple date_select helpers on one page or
-# you want to specify the name of the date on the form. For example:
-# When I select "April 26, 1982" as the "Date of Birth" date
-When /^I select "([^\"]*)" as the "([^\"]*)" date$/ do |date, date_label|
- select_date(date, :from => date_label)
-end
-
-When /^I check "([^\"]*)"$/ do |field|
- check(field)
-end
-
-When /^I uncheck "([^\"]*)"$/ do |field|
- uncheck(field)
-end
-
-When /^I choose "([^\"]*)"$/ do |field|
- choose(field)
-end
-
-When /^I attach the file at "([^\"]*)" to "([^\"]*)"$/ do |path, field|
- attach_file(field, path)
-end
-
-Then /^I should see "([^\"]*)"$/ do |text|
- response.should contain(text)
-end
-
-Then /^I should see \/([^\/]*)\/$/ do |regexp|
- regexp = Regexp.new(regexp)
- response.should contain(regexp)
-end
-
-Then /^I should not see "([^\"]*)"$/ do |text|
- response.should_not contain(text)
-end
-
-Then /^I should not see \/([^\/]*)\/$/ do |regexp|
- regexp = Regexp.new(regexp)
- response.should_not contain(regexp)
-end
-
-Then /^the "([^\"]*)" field should contain "([^\"]*)"$/ do |field, value|
- field_labeled(field).value.should =~ /#{value}/
-end
-
-Then /^the "([^\"]*)" field should not contain "([^\"]*)"$/ do |field, value|
- field_labeled(field).value.should_not =~ /#{value}/
-end
-
-Then /^the "([^\"]*)" checkbox should be checked$/ do |label|
- field_labeled(label).should be_checked
-end
-
-Then /^the "([^\"]*)" checkbox should not be checked$/ do |label|
- field_labeled(label).should_not be_checked
-end
-
-Then /^I should be on (.+)$/ do |page_name|
- URI.parse(page.url).path.should == path_to(page_name)
-end
View
30 _backup/test/features/support/env.rb
@@ -1,30 +0,0 @@
-ENV["RAILS_ENV"] ||= "test"
-
-$: << File.expand_path(File.dirname(__FILE__) + "/../../../lib")
-
-require 'rubygems'
-require 'cucumber/formatter/unicode'
-require 'spork'
-require 'steam'
-
-Spork.prefork do
- require File.expand_path(File.dirname(__FILE__) + '/../../fixtures/rails/config/environment.rb')
- ActiveRecord::Base.establish_connection(:test)
-
- root = File.expand_path(RAILS_ROOT + '/public')
- static = Steam::Connection::Static.new(:root => root)
- rails = Steam::Connection::Rails.new
-
- connection = Rack::Cascade.new([static, rails])
- Steam::Browser::HtmlUnit::Drb::Service.daemonize(connection)
- sleep(0.25)
-
- World do
- browser = Steam::Browser::HtmlUnit.new(:drb => true)
- Steam::Session::Rails.new(browser)
- end
-end
-
-Spork.each_run do
-end
-
View
0  _backup/test/features/support/hooks.rb
No changes.
View
15 _backup/test/features/support/paths.rb
@@ -1,15 +0,0 @@
-module NavigationHelpers
- def path_to(page_name)
- case page_name
- when /the home page/
- '/'
- when /the users index page/
- users_path
- else
- raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
- "Now, go and add a mapping in #{__FILE__}"
- end
- end
-end
-
-World(NavigationHelpers)
View
17 _backup/test/features/support/responses.rb
@@ -1,17 +0,0 @@
-# module MockResponsesHelper
-# def mock
-# p 'mock!'
-# end
-# end
-#
-# World(MockResponsesHelper)
-#
-# # Before do
-# # p self
-# # end
-#
-# # mock.get '...', 'body'
-#
-# AfterConfiguration do |config|
-# p config
-# end
View
327 _backup/test/fixtures/page.html
@@ -1,327 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
- <title>
- | shiftplan.com
- </title>
- <script>
-//<![CDATA[
-
- // var Plan = {}
-
-//]]>
- </script>
- <script src="/javascripts/lib/core_ext/array.js?1254954865" type="text/javascript">
- </script>
- <script src="/javascripts/lib/core_ext/date.js?1254954865" type="text/javascript">
- </script>
- <script src="/javascripts/lib/core_ext/uri.js?1254954865" type="text/javascript">
- </script>
- <script src="/javascripts/lib/ejs.js?1255789752" type="text/javascript">
- </script>
- <script src="/javascripts/lib/jquery/jquery.js?1256440010" type="text/javascript">
- </script>
- <script src="/javascripts/lib/jquery/jquery-ui.js?1255811444" type="text/javascript">
- </script>
- <script src="/javascripts/lib/jquery/jquery-plugin-form.js?1255290274" type="text/javascript">
- </script>
- <script src="/javascripts/lib/jquery/jquery-plugin-simulate.js?1256440383" type="text/javascript">
- </script>
- <script src="/javascripts/shiftplan/cursor.js?1255871010" type="text/javascript">
- </script>
- <script src="/javascripts/shiftplan/resource.js?1255866245" type="text/javascript">
- </script>
- <script src="/javascripts/shiftplan/plan.js?1255866319" type="text/javascript">
- </script>
- <script src="/javascripts/shiftplan/plan/shifts.js?1255866295" type="text/javascript">
- </script>
- <script src="/javascripts/shiftplan/plan/shift.js?1256539729" type="text/javascript">
- </script>
- <script src="/javascripts/shiftplan/plan/requirement.js?1255864170" type="text/javascript">
- </script>
- <script src="/javascripts/shiftplan/plan/assignment.js?1255864170" type="text/javascript">
- </script>
- <script src="/javascripts/shiftplan/plan/employee.js?1256546126" type="text/javascript">
- </script>
- <script src="/javascripts/shiftplan/plan/workplace.js?1255790802" type="text/javascript">
- </script>
- <script src="/javascripts/shiftplan/plan/qualification.js?1255790802" type="text/javascript">
- </script>
- <script src="/javascripts/shiftplan/stuff/dialogs.js?1255270477" type="text/javascript">
- </script>
- <script src="/javascripts/shiftplan/stuff/lists.js?1256416893" type="text/javascript">
- </script>
- <script src="/javascripts/shiftplan/stuff/workplaces.js?1255290274" type="text/javascript">
- </script>
- <script src="/javascripts/application.js?1256417694" type="text/javascript">
- </script>
- <link href="/stylesheets/reset.css?1252173326" media="screen" rel="stylesheet" type="text/css"/>
- <link href="/stylesheets/shiftplan/plan.css?1256303813" media="screen" rel="stylesheet" type="text/css"/>
- <link href="/stylesheets/shiftplan/resources.css?1255890661" media="screen" rel="stylesheet" type="text/css"/>
- <link href="/stylesheets/shiftplan/sidebar.css?1256304008" media="screen" rel="stylesheet" type="text/css"/>
- <link href="/stylesheets/application.css?1256395883" media="screen" rel="stylesheet" type="text/css"/>
- <script type="text/javascript">
-//<![CDATA[
-
- //<![CDATA[
- window._auth_token_name = 'authenticity_token';
- window._auth_token = 'R6l4RFYXPaOpwx6HB1balwGN9NBnTa67uRb3pGGC4Jk=';
- //]]>
-
-//]]>
- </script>
- <style type="text/css">
-
- .plan .employee_1,
-.employee_1 div {
- background-image: url(http://gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e.png?r=PG&amp;s=30);
-}.plan .employee_2,
-.employee_2 div {
- background-image: url(http://gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e.png?r=PG&amp;s=30);
-}
- .plan .workplace_1,
-.workplace_1 div {
- background-color: #ff8c8c;
-}
-#workplace_1 div.color {
- background-color: #ff8c8c;
-}
-.plan .workplace_2,
-.workplace_2 div {
- background-color: #ffc58c;
-}
-#workplace_2 div.color {
- background-color: #ffc58c;
-}
-
- .plan .qualification_2,
-.qualification_2 div {
- border-color: #ffcf3f;
-}
-#qualification_2 div.color {
- background-color: #ffcf3f;
-}
-
-.plan .qualification.any,
-.qualification.any div {
- border-color: transparent;
-}.plan .qualification_1,
-.qualification_1 div {
- border-color: #ff6f3f;
-}
-#qualification_1 div.color {
- background-color: #ff6f3f;
-}
-
-.plan .qualification.any,
-.qualification.any div {
- border-color: transparent;
-}
-
- </style>
- </head>
- <body class="ui-droppable">
- <div>
- <ul id="navigation">
- <li>
- <a href="/">
- Overview
- </a>
- </li>
- <li>
- <a href="/plans">
- Plans
- </a>
- </li>
- <li>
- <a href="/workplaces">
- Workplaces
- </a>
- </li>
- <li>
- <a href="/employees">
- Employees
- </a>
- </li>
- <li>
- <a href="/qualifications">
- Qualifications
- </a>
- </li>
- </ul>
- <div id="login_status">
-
- Logged in as fritz@thielemann.de
- (
- <a href="/logout" onclick="var f = document.createElement(&apos;form&apos;); f.style.display = &apos;none&apos;; this.parentNode.appendChild(f); f.method = &apos;POST&apos;; f.action = this.href;var m = document.createElement(&apos;input&apos;); m.setAttribute(&apos;type&apos;, &apos;hidden&apos;); m.setAttribute(&apos;name&apos;, &apos;_method&apos;); m.setAttribute(&apos;value&apos;, &apos;delete&apos;); f.appendChild(m);f.submit();return false;">
- Logout
- </a>
- )
-
- </div>
- <style type="text/css">
-
- .plan .employee_1,
-.employee_1 div {
- background-image: url(http://gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e.png?r=PG&amp;s=30);
-}.plan .employee_2,
-.employee_2 div {
- background-image: url(http://gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e.png?r=PG&amp;s=30);
-}
- .plan .workplace_1,
-.workplace_1 div {
- background-color: #ff8c8c;
-}
-#workplace_1 div.color {
- background-color: #ff8c8c;
-}
-.plan .workplace_2,
-.workplace_2 div {
- background-color: #ffc58c;
-}
-#workplace_2 div.color {
- background-color: #ffc58c;
-}
-
- .plan .qualification_2,
-.qualification_2 div {
- border-color: #ffcf3f;
-}
-#qualification_2 div.color {
- background-color: #ffcf3f;
-}
-
-.plan .qualification.any,
-.qualification.any div {
- border-color: transparent;
-}.plan .qualification_1,
-.qualification_1 div {
- border-color: #ff6f3f;
-}
-#qualification_1 div.color {
- background-color: #ff6f3f;
-}
-
-.plan .qualification.any,
-.qualification.any div {
- border-color: transparent;
-}
-
- </style>
- <div class="plan" data-duration="720" data-start="480" id="plan_1">
- <h1>
- Plan 1
- <span class="dates">
- 2009-09-07 - 2009-09-08
- </span>
- </h1>
- <div class="day" data-day="20090907">
- <ul class="shifts ui-droppable">
- <li class="shift workplace_3 ui-droppable ui-draggable" data-duration="300" data-start="480" data-workplace-id="3" id="shift_1" style="left: 1px; width: 359px;">
- <h3>
- Reception
- </h3>
- <ul class="requirements">
- <li class="requirement ui-draggable ui-droppable" id="requirement_1"/>
- </ul>
- <span class="resize_handle left ui-draggable" style="position: null;">
- </span>
- <span class="resize_handle right ui-draggable" style="position: null;">
- </span>
- </li>
- <li class="shift workplace_1 ui-droppable ui-draggable" data-duration="240" data-start="540" data-workplace-id="1" id="shift_2" style="left: 73px; width: 287px;">
- <h3>
- Kitchen
- </h3>
- <ul class="requirements">
- <li class="requirement qualification_1 ui-draggable ui-droppable" id="requirement_2">
- <a href="/employees/1" class="assignment employee_1 qualification_1 dialog ui-draggable"/>
- </li>
- </ul>
- <span class="resize_handle left ui-draggable" style="position: null;">
- </span>
- <span class="resize_handle right ui-draggable" style="position: null;">
- </span>
- </li>
- <li class="shift workplace_2 ui-droppable ui-draggable" data-duration="240" data-start="720" data-workplace-id="2" id="shift_3" style="left: 289px; width: 287px;">
- <h3>
- Bar
- </h3>
- <ul class="requirements">
- <li class="requirement qualification_2 ui-draggable ui-droppable" id="requirement_3"/>
- </ul>
- <span class="resize_handle left ui-draggable" style="position: null;">
- </span>
- <span class="resize_handle right ui-draggable" style="position: null;">
- </span>
- </li>
- </ul>
- </div>
- <div class="day" data-day="20090908">
- <ul class="shifts ui-droppable">
- </ul>
- </div>
- </div>
- <div id="sidebar">
- <h3>
- Employees
- </h3>
- <ul id="employees">
- <li>
- <a href="/employees/1" class="employee employee_1 dialog" data-possible-workplaces="workplace_1" data-qualifications="qualification_1">
- <div class="ui-draggable">
- </div>
- CK
- </a>
- </li>
- <li>
- <a href="/employees/2" class="employee employee_2 dialog" data-possible-workplaces="workplace_2" data-qualifications="qualification_2">
- <div class="ui-draggable">
- </div>
- LK
- </a>
- </li>
- </ul>
- <h3>
- Workplaces
- </h3>
- <ul id="workplaces">
- <li>
- <a href="/workplaces/1" class="workplace workplace_1 dialog" data-default-staffing="[]" data-workplace-id="1">
- <div class="ui-draggable">
- </div>
- Kitchen
- </a>
- </li>
- <li>
- <a href="/workplaces/2" class="workplace workplace_2 dialog" data-default-staffing="[]" data-workplace-id="2">
- <div class="ui-draggable">
- </div>
- Bar
- </a>
- </li>
- </ul>
- <h3>
- Qualifications
- </h3>
- <ul id="qualifications">
- <li>
- <a href="/qualifications/2" class="qualification qualification_2 dialog" data-possible-workplaces="workplace_2">
- <div class="ui-draggable">
- </div>
- Barkeeper
- </a>
- </li>
- <li>
- <a href="/qualifications/1" class="qualification qualification_1 dialog" data-possible-workplaces="workplace_1">
- <div class="ui-draggable">
- </div>
- Chef
- </a>
- </li>
- <!--<li><a href="#" class="qualification any">(Beliebig)</a></li>--> </ul>
- </div>
- </div>
- </body>
-</html>
View
BIN  _backup/test/fixtures/rails.png
Deleted file not rendered
View
10 _backup/test/fixtures/rails/Rakefile
@@ -1,10 +0,0 @@
-# Add your own tasks in files placed in lib/tasks ending in .rake,
-# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
-
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-require 'tasks/rails'
View
2  _backup/test/fixtures/rails/app/controllers/application_controller.rb
@@ -1,2 +0,0 @@
-class ApplicationController < ActionController::Base
-end
View
18 _backup/test/fixtures/rails/app/controllers/users_controller.rb
@@ -1,18 +0,0 @@
-class UsersController < ApplicationController
- def index
- @users = User.all
- end
-
- def show
- @user = User.find(params[:id])
- end
-
- def create
- user = User.new(params[:user])
- if user.save
- redirect_to user_url(user)
- else
- render :text => 'nope', :status => :unprocessable_entity
- end
- end
-end
View
3  _backup/test/fixtures/rails/app/models/user.rb
@@ -1,3 +0,0 @@
-class User < ActiveRecord::Base
- validates_uniqueness_of :name
-end
View
25 _backup/test/fixtures/rails/app/views/layouts/application.html.erb
@@ -1,25 +0,0 @@
-<html>
- <head>
- <%= stylesheet_link_tag 'application' %>
- <%= javascript_include_tag 'jquery', 'jquery-ui', 'application' %>
-
- <!--<script>
- $(document).ready(function() {
- $('h1').droppable({
- tolerance: 'touch',
- drop: function() {
- document.title = 'DROPPED!'
- }
- })
- $('a').draggable({
- start: function() {
- document.title = 'DRAGGING!'
- }
- })
- })
- </script>-->
- </head>
- <body>
- <%= yield %>
- <body>
-<html>
View
6 _backup/test/fixtures/rails/app/views/users/index.html.erb
@@ -1,6 +0,0 @@
-<h1>Users</h1>
-<ul id="users">
- <% User.all.each do |user| %>
- <li id="<%= dom_id(user) %>"><%= link_to user.name, user %></li>
- <% end %>
-</ul>
View
2  _backup/test/fixtures/rails/app/views/users/show.html.erb
@@ -1,2 +0,0 @@
-<%= link_to 'Users', users_path %>
-<h1><%= @user.name %></h1>
View
110 _backup/test/fixtures/rails/config/boot.rb
@@ -1,110 +0,0 @@
-# Don't change this file!
-# Configure your app in config/environment.rb and config/environments/*.rb
-
-RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
-
-module Rails
- class << self
- def boot!
- unless booted?
- preinitialize
- pick_boot.run
- end
- end
-
- def booted?
- defined? Rails::Initializer
- end
-
- def pick_boot
- (vendor_rails? ? VendorBoot : GemBoot).new
- end
-
- def vendor_rails?
- File.exist?("#{RAILS_ROOT}/vendor/rails")
- end
-
- def preinitialize
- load(preinitializer_path) if File.exist?(preinitializer_path)
- end
-
- def preinitializer_path
- "#{RAILS_ROOT}/config/preinitializer.rb"
- end
- end
-
- class Boot
- def run
- load_initializer
- Rails::Initializer.run(:set_load_path)
- end
- end
-
- class VendorBoot < Boot
- def load_initializer
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- Rails::Initializer.run(:install_gem_spec_stubs)
- Rails::GemDependency.add_frozen_gem_path
- end
- end
-
- class GemBoot < Boot
- def load_initializer
- self.class.load_rubygems
- load_rails_gem
- require 'initializer'
- end
-
- def load_rails_gem
- if version = self.class.gem_version
- gem 'rails', version
- else
- gem 'rails'
- end
- rescue Gem::LoadError => load_error
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
- exit 1
- end
-
- class << self
- def rubygems_version
- Gem::RubyGemsVersion rescue nil
- end
-
- def gem_version
- if defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION
- elsif ENV.include?('RAILS_GEM_VERSION')
- ENV['RAILS_GEM_VERSION']
- else
- parse_gem_version(read_environment_rb)
- end
- end
-
- def load_rubygems
- min_version = '1.3.2'
- require 'rubygems'
- unless rubygems_version >= min_version
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
- exit 1
- end
-
- rescue LoadError
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
- exit 1
- end
-
- def parse_gem_version(text)
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
- end
-
- private
- def read_environment_rb
- File.read("#{RAILS_ROOT}/config/environment.rb")
- end
- end
- end
-end
-
-# All that for this:
-Rails.boot!
View
22 _backup/test/fixtures/rails/config/database.yml
@@ -1,22 +0,0 @@
-# SQLite version 3.x
-# gem install sqlite3-ruby (not necessary on OS X Leopard)
-development:
- adapter: sqlite3
- database: db/development.sqlite3
- pool: 5
- timeout: 5000
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-test:
- adapter: sqlite3
- database: db/test.sqlite3
- pool: 5
- timeout: 5000
-
-production:
- adapter: sqlite3
- database: db/production.sqlite3
- pool: 5
- timeout: 5000
View
41 _backup/test/fixtures/rails/config/environment.rb
@@ -1,41 +0,0 @@
-# Be sure to restart your server when you modify this file
-
-# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION
-
-# Bootstrap the Rails environment, frameworks, and default configuration
-require File.join(File.dirname(__FILE__), 'boot')
-
-Rails::Initializer.run do |config|
- # Settings in config/environments/* take precedence over those specified here.
- # Application configuration should go into files in config/initializers
- # -- all .rb files in that directory are automatically loaded.
-
- # Add additional load paths for your own custom dirs
- # config.load_paths += %W( #{RAILS_ROOT}/extras )
-
- # Specify gems that this application depends on and have them installed with rake gems:install
- # config.gem "bj"
- # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
- # config.gem "sqlite3-ruby", :lib => "sqlite3"
- # config.gem "aws-s3", :lib => "aws/s3"
-
- # Only load the plugins named here, in the order given (default is alphabetical).
- # :all can be used as a placeholder for all plugins not explicitly named
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
-
- # Skip frameworks you're not going to use. To use Rails without a database,
- # you must remove the Active Record framework.
- # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
-
- # Activate observers that should always be running
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
-
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
- # Run "rake -D time" for a list of tasks for finding time zone names.
- config.time_zone = 'UTC'
-
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
- # config.i18n.default_locale = :de
-end
View
17 _backup/test/fixtures/rails/config/environments/development.rb
@@ -1,17 +0,0 @@
-# Settings specified here will take precedence over those in config/environment.rb
-
-# In the development environment your application's code is reloaded on
-# every request. This slows down response time but is perfect for development
-# since you don't have to restart the webserver when you make code changes.
-config.cache_classes = false
-
-# Log error messages when you accidentally call methods on nil.
-config.whiny_nils = true
-
-# Show full error reports and disable caching
-config.action_controller.consider_all_requests_local = true
-config.action_view.debug_rjs = true
-config.action_controller.perform_caching = false
-
-# Don't care if the mailer can't send
-config.action_mailer.raise_delivery_errors = false
View
28 _backup/test/fixtures/rails/config/environments/production.rb
@@ -1,28 +0,0 @@
-# Settings specified here will take precedence over those in config/environment.rb
-
-# The production environment is meant for finished, "live" apps.
-# Code is not reloaded between requests
-config.cache_classes = true
-
-# Full error reports are disabled and caching is turned on
-config.action_controller.consider_all_requests_local = false
-config.action_controller.perform_caching = true
-config.action_view.cache_template_loading = true
-
-# See everything in the log (default is :info)
-# config.log_level = :debug
-
-# Use a different logger for distributed setups
-# config.logger = SyslogLogger.new
-
-# Use a different cache store in production
-# config.cache_store = :mem_cache_store
-
-# Enable serving of images, stylesheets, and javascripts from an asset server
-# config.action_controller.asset_host = "http://assets.example.com"
-
-# Disable delivery errors, bad email addresses will be ignored
-# config.action_mailer.raise_delivery_errors = false
-
-# Enable threaded mode
-# config.threadsafe!
View
28 _backup/test/fixtures/rails/config/environments/test.rb
@@ -1,28 +0,0 @@
-# Settings specified here will take precedence over those in config/environment.rb
-
-# The test environment is used exclusively to run your application's
-# test suite. You never need to work with it otherwise. Remember that
-# your test database is "scratch space" for the test suite and is wiped
-# and recreated between test runs. Don't rely on the data there!
-config.cache_classes = true
-
-# Log error messages when you accidentally call methods on nil.
-config.whiny_nils = true
-
-# Show full error reports and disable caching
-config.action_controller.consider_all_requests_local = true
-config.action_controller.perform_caching = false
-config.action_view.cache_template_loading = true
-
-# Disable request forgery protection in test environment
-config.action_controller.allow_forgery_protection = false
-
-# Tell Action Mailer not to deliver emails to the real world.
-# The :test delivery method accumulates sent emails in the
-# ActionMailer::Base.deliveries array.
-config.action_mailer.delivery_method = :test
-
-# Use SQL instead of Active Record's schema dumper when creating the test database.
-# This is necessary if your schema can't be completely dumped by the schema dumper,
-# like if you have constraints or database-specific column types
-# config.active_record.schema_format = :sql
View
7 _backup/test/fixtures/rails/config/initializers/backtrace_silencers.rb
@@ -1,7 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
-# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
-
-# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
-# Rails.backtrace_cleaner.remove_silencers!
View
10 _backup/test/fixtures/rails/config/initializers/inflections.rb
@@ -1,10 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Add new inflection rules using the following format
-# (all these examples are active by default):
-# ActiveSupport::Inflector.inflections do |inflect|
-# inflect.plural /^(ox)$/i, '\1en'
-# inflect.singular /^(ox)en/i, '\1'
-# inflect.irregular 'person', 'people'
-# inflect.uncountable %w( fish sheep )
-# end
View
5 _backup/test/fixtures/rails/config/initializers/mime_types.rb
@@ -1,5 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Add new mime types for use in respond_to blocks:
-# Mime::Type.register "text/richtext", :rtf
-# Mime::Type.register_alias "text/html", :iphone
View
21 _backup/test/fixtures/rails/config/initializers/new_rails_defaults.rb
@@ -1,21 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# These settings change the behavior of Rails 2 apps and will be defaults
-# for Rails 3. You can remove this initializer when Rails 3 is released.
-
-if defined?(ActiveRecord)
- # Include Active Record class name as root for JSON serialized output.
- ActiveRecord::Base.include_root_in_json = true
-
- # Store the full class name (including module namespace) in STI type column.
- ActiveRecord::Base.store_full_sti_class = true
-end
-
-ActionController::Routing.generate_best_match = false
-
-# Use ISO 8601 format for JSON serialized times and dates.
-ActiveSupport.use_standard_json_time_format = true
-
-# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
-# if you're including raw json in an HTML page.
-ActiveSupport.escape_html_entities_in_json = false
View
15 _backup/test/fixtures/rails/config/initializers/session_store.rb
@@ -1,15 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Your secret key for verifying cookie session data integrity.
-# If you change this key, all old sessions will become invalid!
-# Make sure the secret is at least 30 characters and all random,
-# no regular words or you'll be exposed to dictionary attacks.
-ActionController::Base.session = {
- :key => '_rails_session',
- :secret => '51b027fe7493a4562e126a151d77224e2f7faf85c6a6e3f1b4131a010eb6c014673fa175f412c51bf1795d56093c5576e3f0f4dd6f23e4635c699f4bd864cd76'
-}
-
-# Use the database for sessions instead of the cookie-based default,
-# which shouldn't be used to store highly confidential information
-# (create the session table with "rake db:sessions:create")
-# ActionController::Base.session_store = :active_record_store
View
5 _backup/test/fixtures/rails/config/locales/en.yml
@@ -1,5 +0,0 @@
-# Sample localization file for English. Add more files in this directory for other locales.
-# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
-
-en:
- hello: "Hello world"
View
3  _backup/test/fixtures/rails/config/routes.rb
@@ -1,3 +0,0 @@
-ActionController::Routing::Routes.draw do |map|
- map.resources 'users'
-end
View
BIN  _backup/test/fixtures/rails/db/development.sqlite3
Binary file not shown
View
12 _backup/test/fixtures/rails/db/migrate/20090926101010_create_users.rb
@@ -1,12 +0,0 @@
-class CreateUsers < ActiveRecord::Migration
- def self.up
- create_table :users, :force => true do |t|
- t.string :name
- t.timestamps
- end
- end
-
- def self.down
- drop_table :users
- end
-end
View
20 _backup/test/fixtures/rails/db/schema.rb
@@ -1,20 +0,0 @@
-# This file is auto-generated from the current state of the database. Instead of editing this file,
-# please use the migrations feature of Active Record to incrementally modify your database, and
-# then regenerate this schema definition.
-#
-# Note that this schema.rb definition is the authoritative source for your database schema. If you need
-# to create the application database on another system, you should be using db:schema:load, not running
-# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
-# you'll amass, the slower it'll run and the greater likelihood for issues).
-#
-# It's strongly recommended to check this file into your version control system.
-
-ActiveRecord::Schema.define(:version => 20090926101010) do
-
- create_table "users", :force => true do |t|
- t.string "name"
- t.datetime "created_at"
- t.datetime "updated_at"
- end
-
-end
View
BIN  _backup/test/fixtures/rails/db/test.sqlite3
Binary file not shown
View
BIN  _backup/test/fixtures/rails/public/images/rails.png
Deleted file not rendered
View
8 _backup/test/fixtures/rails/public/javascripts/ajax_call.js
@@ -1,8 +0,0 @@
-http = new XMLHttpRequest();
-http.open("GET", "/ajax");
-http.onreadystatechange=function() {
- if(http.readyState == 4) {
- document.title = 'ajaxed!'
- }
-}
-http.send(null);
View
3  _backup/test/fixtures/rails/public/javascripts/application.js
@@ -1,3 +0,0 @@
-$(document).ready(function() {
- document.title = 'FOO'
-})
View
9,137 _backup/test/fixtures/rails/public/javascripts/jquery-ui.js
0 additions, 9,137 deletions not shown
View
4,376 _backup/test/fixtures/rails/public/javascripts/jquery.js
0 additions, 4,376 deletions not shown
View
3  _backup/test/fixtures/rails/public/stylesheets/application.css
@@ -1,3 +0,0 @@
-body {
- background-color: yellow;
-}
View
32 _backup/test/playground/drb/daemonized_client.rb
@@ -1,32 +0,0 @@
-$: << File.expand_path(File.dirname(__FILE__) + "/../../../lib")
-require 'rubygems'
-require 'daemons'
-require 'drb'
-require 'steam'
-include Steam
-
-
-# a = Daemons.call do
-# DRb.start_service('druby://localhost:9000', Object.new)
-# end
-
-# server = Daemons.call do
-# connection = Connection::Mock.new
-# connection.mock :get, 'http://localhost:3000/', 'FOOOO'
-# Browser::HtmlUnit::Drb::Service.start(connection)
-# end
-# at_exit { server.stop }
-
-connection = Connection::Mock.new
-connection.mock :get, 'http://localhost:3000/', 'FOOOO'
-server = Browser::HtmlUnit::Drb::Service.daemonize(connection)
-sleep(0.5)
-
-# p server.running?
-browser = Browser::HtmlUnit.new(:drb => true)
-status, headers, response = browser.request('http://localhost:3000/')
-
-puts response.status
-puts response.body
-
-
View
56 _backup/test/playground/drb/daemons.rb
@@ -1,56 +0,0 @@
-lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '../../lib'))
-
-if File.exist?(File.join(lib_dir, 'daemons.rb'))
- $LOAD_PATH.unshift lib_dir
-else
- begin; require 'rubygems'; rescue ::Exception; end
-end
-
-
-require 'daemons'
-
-testfile = File.expand_path(__FILE__) + '.log'
-
-
-# On the first call to <tt<call</tt>, an application group (accessible by <tt>Daemons.group</tt>)
-# will be created an the options will be kept within, so you only have to specify
-# <tt>:multiple</tt> once.
-#
-
-options = {
-# :ontop => true,
- :multiple => true
-}
-
-
-Daemons.call(options) do
- File.open(testfile, 'w') {|f|
- f.puts "test"
- }
-
- loop { puts "1"; sleep 5 }
-end
-puts "first task started"
-
-Daemons.call do
- loop { puts "2"; sleep 4 }
-end
-puts "second task started"
-
-# NOTE: this process will exit after 5 seconds
-Daemons.call do
- puts "3"
- sleep 5
-end
-puts "third task started"
-
-puts "waiting 20 seconds..."
-sleep(20)
-
-# This call would result in an exception as it will try to kill the third process
-# which has already terminated by that time; but using the 'true' parameter forces the
-# stop_all procedure.
-puts "trying to stop all tasks..."
-Daemons.group.stop_all(true)
-
-puts "done"
View
22 _backup/test/playground/drb/forker.rb
@@ -1,22 +0,0 @@
-$: << File.expand_path(File.dirname(__FILE__) + "/../../../lib")
-require 'rubygems'
-require 'drb'
-require 'steam'
-include Steam
-
-# Forker.new do
-# connection = Connection::Mock.new
-# connection.mock :get, 'http://localhost:3000/', 'FOOOO'
-# Browser::HtmlUnit::Drb::Service.start(connection)
-# end
-
-connection = Connection::Mock.new
-connection.mock :get, 'http://localhost:3000/', 'FOOOO'
-server = Browser::HtmlUnit::Drb::Service.daemonize(connection)
-sleep(0.5)
-
-browser = Browser::HtmlUnit.new(:drb => true)
-status, headers, response = browser.request('http://localhost:3000/')
-
-puts response.status
-puts response.body
View
10 _backup/test/playground/drb/server.rb
@@ -1,10 +0,0 @@
-$: << File.expand_path(File.dirname(__FILE__) + "/../../../lib")
-require 'drb'
-require 'steam'
-include Steam
-
-
-mock = Connection::Mock.new
-mock.mock :get, 'http://localhost:3000/', 'FOOOO'
-
-Browser::HtmlUnit::Drb::Service.start(mock)
View
154 _backup/test/test_helper.rb
@@ -1,154 +0,0 @@
-require 'test/unit'
-require 'rubygems'
-require 'mocha'
-require 'pp'
-
-TEST_ROOT = File.dirname(__FILE__)
-PLUGIN_ROOT = File.expand_path(TEST_ROOT + "/..")
-
-$: << PLUGIN_ROOT + '/lib'
-
-require 'steam'
-
-Steam::Java.import('com.gargoylesoftware.htmlunit.StringWebResponse')
-Steam::Java.import('com.gargoylesoftware.htmlunit.WebClient')
-Steam::Java.import('com.gargoylesoftware.htmlunit.TopLevelWindow')
-Steam::Java.import('com.gargoylesoftware.htmlunit.DefaultPageCreator')
-
-module TestHelper
- attr_reader :page
-
- def assert_response_contains(text, options = {})
- tag_name = options[:in] || 'body'
- status, headers, response = yield
- assert_equal 200, status
- assert_match %r(<#{tag_name}>\s*#{text}\s*<\/#{tag_name}>), response.body.join
- end
-
- def dom(html)
- Steam::Dom::Nokogiri::Page.new(html)
- end
-
- def patron_response(body)
- @response = Patron::Response.new
- @response.instance_eval do
- @body = body
- end
- @response
- end
-end
-
-module HtmlUnitHelper
- def html(*elements)
- scripts = ''
- fields = ''
- elements.each do |element|
- case element
- when :field
- fields << '<label for="field">Label for field</label><input type="text" id="field" name="field" />'
- when :textarea
- fields << '<label for="textarea">Label for textarea</label><textarea id="textarea" name="textarea"></textarea>'
- when :checkbox
- fields << '<label for="checkbox">Label for checkbox</label><input id="checkbox" type="checkbox" name="checkbox" value="1" />'
- when :radio
- fields << '<label for="radio1">Label for radio</label><input id="radio1" type="radio" name="radio" value="radio" />' \
- << '<label for="radio2">Label for tv</label><input id="radio2" type="radio" name="radio" value="tv" />'
- when :select
- fields << '<label for="select">Label for select</label><select id="select" name="select"><option value=""></option><option value="foo">foo</option></select>'
- when :file
- fields << '<label for="file">Label for file</label><input id="file" type="file" name="file" />'
- when :date
- fields << '<label for="event_date">Date</label>' \
- << '<select id="event_date_1i" name="event_date(1i)"><option value="2008">2008</option><option value="2009">2009</option><option value="2010">2010</option></select>' \
- << '<select id="event_date_2i" name="event_date(2i)"><option value="10">October</option><option value="11">November</option><option value="12">December</option></select>' \
- << '<select id="event_date_3i" name="event_date(3i)"><option value="6">6</option><option value="7">7</option><option value="8">8</option></select>'
- when :datetime
- fields << '<label for="event_datetime">Datetime</label>' \
- << '<select id="event_datetime_1i" name="event_datetime(1i)"><option value="2008">2008</option><option value="2009">2009</option><option value="2010">2010</option></select>' \
- << '<select id="event_datetime_2i" name="event_datetime(2i)"><option value="10">October</option><option value="11">November</option><option value="12">December</option></select>' \
- << '<select id="event_datetime_3i" name="event_datetime(3i)"><option value="6">6</option><option value="7">7</option><option value="8">8</option></select> : ' \
- << '<select id="event_datetime_4i" name="event_datetime(4i)"><option value="18">18</option><option value="19">19</option><option value="20">20</option></select>' \
- << '<select id="event_datetime_5i" name="event_datetime(5i)"><option value="0">00</option><option value="1">01</option><option value="2">02</option></select>'
- when :time
- fields << '<label for="event_time">Time</label>' \
- << '<select id="event_time_4i" name="event_time(4i)"><option value="18">18</option><option value="19">19</option><option value="20">20</option></select>' \
- << '<select id="event_time_5i" name="event_time(5i)"><option value="0">00</option><option value="1">01</option><option value="2">02</option></select>'
- when :jquery
- scripts << '<script src="/javascripts/jquery.js" type="text/javascript"></script>'
- when :jquery_ui
- scripts << '<script src="/javascripts/jquery-ui.js" type="text/javascript"></script>'
- when :foo
- scripts << '<script src="/javascripts/foo.js" type="text/javascript"></script>'
- when :hover
- scripts << '<script src="/javascripts/hover.js" type="text/javascript"></script>'
- when :blur
- scripts << '<script src="/javascripts/blur.js" type="text/javascript"></script>'
- when :focus
- scripts << '<script src="/javascripts/focus.js" type="text/javascript"></script>'
- when :double_click
- scripts << '<script src="/javascripts/double_click.js" type="text/javascript"></script>'
- when :drag
- scripts << '<script src="/javascripts/drag.js" type="text/javascript"></script>'
- end
- end
-
- html = <<-erb
- <html>
- <head><%= scripts %></head>
- <body>
- <p id="paragraph"></p>
- <p><a href="/link" id="link">link</a></p>
- <form action="/form" method="get" id="form" enctype="multipart/form-data">
- <%= fields %>
- <input type="submit" value="button" />
- </form>
- </body>
- </html>
- erb
-
- ERB.new(html).result(binding)
- end
-
- def setup
- @mock = Steam::Connection::Mock.new
-
- root = File.expand_path(TEST_ROOT + '/fixtures')
- static = Steam::Connection::Static.new(:root => root)
-
- connection = Rack::Cascade.new([static, @mock])
- @browser = Steam::Browser::HtmlUnit.new(connection)
- end
-
- def perform(method, url, response)
- @mock.mock(method, url, response)
- @status, @headers, @response = @browser.call(Steam::Request.env_for(url))
- end
-end
-
-class LocatorTest < Test::Unit::TestCase
- include Steam
- include TestHelper
-
- attr_reader :response, :page
-
- def setup
- @response = Rack::Response.new
- end
-
- def default_test
- end
-end
-
-class NokogiriLocatorTest < LocatorTest
- def dom(html)
- Dom::Nokogiri::Page.build(nil, html)
- end
-end
-
-class HtmlUnitLocatorTest < LocatorTest
-
- def dom(html)
- Dom::Nokogiri::Page.build(nil, html)
- end
-end
-
View
16 lib/steam/browser.rb
@@ -1,7 +1,23 @@
# We currently only implement HtmlUnit as a browser. Maybe at some point
# Webdriver might be an interesting alternative.
+
+require 'core_ext/ruby/string/camelize'
+
module Steam
module Browser
autoload :HtmlUnit, 'steam/browser/html_unit'
+
+ class << self
+ def create(*args)
+ options = args.last.is_a?(Hash) ? args.pop : {}
+ connection = args.pop
+
+ type = args.pop || :html_unit
+ type = const_get(type.to_s.camelize)
+ type = type.const_get('Drb') if options[:daemon]
+
+ type.new(connection, :daemon => true)
+ end
+ end
end
end
View
0  _backup/test/playground/connection.rb → test/playground/connection.rb
File renamed without changes
View
7 test/playground/drb.rb
@@ -4,12 +4,11 @@
include Steam
-@app = Connection::Mock.new
root = File.expand_path("../../fixtures/public", __FILE__)
-static = Connection::Static.new(:root => root, :urls => %w(/ /javascripts /stylesheets))
-connection = Rack::Cascade.new([static, @app])
+connection = Connection::Static.new(:root => root, :urls => %w(/ /javascripts /stylesheets))
-browser = Browser::HtmlUnit::Drb.new(connection, :daemon => true)
+
+browser = Steam::Browser.create(:html_unit, connection, :daemon => true)
browser.request('/index.html')
puts browser.response.status
View
0  _backup/test/playground/java_signature.rb → test/playground/java_signature.rb
File renamed without changes
View
0  _backup/test/playground/nokogiri.rb → test/playground/nokogiri.rb
File renamed without changes
View
0  _backup/test/playground/put_headers.rb → test/playground/put_headers.rb
File renamed without changes
View
0  _backup/test/playground/rack.rb → test/playground/rack.rb
File renamed without changes
View
0  _backup/test/playground/rjb_bind.rb → test/playground/rjb_bind.rb
File renamed without changes
View
0  ...up/test/playground/stack_level_problem.rb → test/playground/stack_level_problem.rb
File renamed without changes
View
0  _backup/test/playground/thread_problem.rb → test/playground/thread_problem.rb
File renamed without changes
View
0  _backup/test/playground/web_response_data.rb → test/playground/web_response_data.rb
File renamed without changes
View
0  _backup/test/playground/webrat.rb → test/playground/webrat.rb
File renamed without changes
View
0  ...kup/test/playground/xhr_accept_headers.rb → test/playground/xhr_accept_headers.rb
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.