Skip to content

Instantly share code, notes, and snippets.

require 'rubygems'
require_gem 'activerecord'
MIGRATIONS_PATH="#{File.dirname(__FILE__)}/db/migrate/"
# Set up ActiveRecord::Base.connection
# Migrate
database_type = ARGV[0]
create_table "billing_accounts", :id => false, :force => true do |t|
t.column "id", :string, :limit => '36'
t.column "name", :string
end
execute "ALTER TABLE billing_accounts ADD PRIMARY KEY (id)"
class APLMoveDocWrapper < DocWrapperBase
property :description, :string, "./td[1]", :parser => lambda { |x| x.sub('&nbsp;', '') }
property :location, :string, "./td[2]/a"
property :date, :time, "./td[5]", :parser => APL_DATE_PARSER
property :vessel, :string, "./td[3]/a"
property :voyage, :string, "./td[3]/a"
end
First Request to get login form:
GET /mori/ HTTP/1.1
Accept-Language: en-us,en;q=0.5
Accept: */*
User-Agent: WWW-Mechanize/0.9.0 (http://rubyforge.org/projects/mechanize/)
Connection: keep-alive
Accept-Encoding: gzip,identity
Host: mori.demo.vitarara.net
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Feature: Login # features/login.feature
In order to secure access to the application.
I want all users to have to login.
Scenario: Present login page to unauthenticated users. # features/login.feature:5
Given I have an account for "test" # features/step_definitions/global_steps.rb:3
And I go to "account root" # features/step_definitions/webrat_steps.rb:6
Then I should see "Login" # features/step_definitions/webrat_steps.rb:94
expected: /Login/m,
got: "<html><body>You are being <a href=\"http://test.localhost/session/new\">redirected</a>.</body></html>" (using =~)
Diff:
World do
session = Webrat::MechanizeSession.new
session.extend(Webrat::Matchers)
session.extend(Webrat::HaveTagMatcher)
session
end
2009-10-06 15:02:58.980::WARN: Error for /quadran/
java.lang.NoClassDefFoundError: org/jruby/RubyTempfile
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
at java.lang.Class.getDeclaredMethods(Class.java:1763)
at org.jruby.RubyModule$MethodClumper.clump(RubyModule.java:574)
at org.jruby.anno.TypePopulator$DefaultTypePopulator.populate(TypePopulator.java:47)
at org.jruby.RubyModule.defineAnnotatedMethodsIndividually(RubyModule.java:660)
at org.jruby.RubyModule.defineAnnotatedMethods(RubyModule.java:562)
at org.jruby.rack.input.RackBaseInput.getClass(RackBaseInput.java:36)