From cf4648cbbb9a6b172df1f53781f2eeb2f7d7ff7e Mon Sep 17 00:00:00 2001 From: Clemens Kofler Date: Sun, 12 Sep 2010 16:03:34 +0200 Subject: [PATCH] make it testable /w rails 2 and 3 (and check it in although rails 3 tests don't pass) --- lib/delocalize/rails_ext/action_view.rb | 2 +- log/test.log | 95 ++++++++++++++ test/delocalize_test.rb | 4 +- .../app/controllers/application_controller.rb | 0 test/{rails_app => rails2_app}/config/boot.rb | 0 .../config/database.yml | 0 .../config/environment.rb | 2 +- .../config/environments/test.rb | 0 .../config/initializers/new_rails_defaults.rb | 0 .../config/initializers/session_store.rb | 0 .../config/routes.rb | 0 test/rails2_app/log/test.log | 119 ++++++++++++++++++ .../vendor/plugins/delocalize | 0 test/rails3_app/.gitignore | 4 + test/rails3_app/Gemfile | 5 + test/rails3_app/Gemfile.lock | 79 ++++++++++++ .../app/controllers/application_controller.rb | 3 + .../app/helpers/application_helper.rb | 2 + .../app/views/layouts/application.html.erb | 14 +++ test/rails3_app/config/application.rb | 44 +++++++ test/rails3_app/config/boot.rb | 13 ++ test/rails3_app/config/database.yml | 3 + test/rails3_app/config/environment.rb | 5 + test/rails3_app/config/environments/test.rb | 35 ++++++ test/test_helper.rb | 15 +-- 25 files changed, 434 insertions(+), 10 deletions(-) create mode 100644 log/test.log rename test/{rails_app => rails2_app}/app/controllers/application_controller.rb (100%) rename test/{rails_app => rails2_app}/config/boot.rb (100%) rename test/{rails_app => rails2_app}/config/database.yml (100%) rename test/{rails_app => rails2_app}/config/environment.rb (91%) rename test/{rails_app => rails2_app}/config/environments/test.rb (100%) rename test/{rails_app => rails2_app}/config/initializers/new_rails_defaults.rb (100%) rename test/{rails_app => rails2_app}/config/initializers/session_store.rb (100%) rename test/{rails_app => rails2_app}/config/routes.rb (100%) create mode 100644 test/rails2_app/log/test.log rename test/{rails_app => rails2_app}/vendor/plugins/delocalize (100%) create mode 100644 test/rails3_app/.gitignore create mode 100644 test/rails3_app/Gemfile create mode 100644 test/rails3_app/Gemfile.lock create mode 100644 test/rails3_app/app/controllers/application_controller.rb create mode 100644 test/rails3_app/app/helpers/application_helper.rb create mode 100644 test/rails3_app/app/views/layouts/application.html.erb create mode 100644 test/rails3_app/config/application.rb create mode 100644 test/rails3_app/config/boot.rb create mode 100644 test/rails3_app/config/database.yml create mode 100644 test/rails3_app/config/environment.rb create mode 100644 test/rails3_app/config/environments/test.rb diff --git a/lib/delocalize/rails_ext/action_view.rb b/lib/delocalize/rails_ext/action_view.rb index 1255e4c..95c0150 100644 --- a/lib/delocalize/rails_ext/action_view.rb +++ b/lib/delocalize/rails_ext/action_view.rb @@ -25,7 +25,7 @@ def to_input_field_tag(field_type, options = {}) hidden_for_integer = field_type == 'hidden' && column.type == :integer # the number will be formatted only if it has no errors - if object.respond_to?(:errors) && !object.errors.invalid?(method_name) + if object.respond_to?(:errors) && !object.errors[method_name].try(:any?) # we don't format integer hidden fields because this breaks nested_attributes options[:value] = number_with_precision(value, opts) unless hidden_for_integer end diff --git a/log/test.log b/log/test.log new file mode 100644 index 0000000..fc2057f --- /dev/null +++ b/log/test.log @@ -0,0 +1,95 @@ + SQL (0.2ms) select sqlite_version(*) + SQL (0.5ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0) + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, 10.0, NULL, NULL, 0.0, NULL, NULL) + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, NULL, NULL, NULL, 0.0, NULL, 10.0) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0) + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, 10.0, NULL, NULL, 0.0, NULL, NULL) + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, NULL, NULL, NULL, 0.0, NULL, 10.0) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0) + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, NULL, NULL, NULL, 0.0, NULL, 10.0) + SQL (0.2ms) select sqlite_version(*) + SQL (0.8ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0) + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, NULL, NULL, NULL, 0.0, NULL, 10.0) + SQL (0.2ms) select sqlite_version(*) + SQL (0.7ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0) + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, NULL, NULL, NULL, 0.0, NULL, 10.0) + SQL (0.3ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0) + SQL (0.2ms) select sqlite_version(*) + SQL (0.5ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0) + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, NULL, NULL, NULL, 0.0, NULL, 10.0) + SQL (0.2ms) select sqlite_version(*) + SQL (0.8ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0) + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, NULL, NULL, NULL, 0.0, NULL, 10.0) + SQL (0.2ms) select sqlite_version(*) + SQL (0.5ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0) + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, 10.0, NULL, NULL, 0.0, NULL, NULL) + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, NULL, NULL, NULL, 0.0, NULL, 10.0) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0) + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, 10.0, NULL, NULL, 0.0, NULL, NULL) + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, NULL, NULL, NULL, 0.0, NULL, 10.0) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0) + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, 10.0, NULL, NULL, 0.0, NULL, NULL) + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, NULL, NULL, NULL, 0.0, NULL, 10.0) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0) + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, 10.0, NULL, NULL, 0.0, NULL, NULL) + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, NULL, NULL, NULL, 0.0, NULL, 10.0) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0) + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, 10.0, NULL, NULL, 0.0, NULL, NULL) + SQL (0.1ms) INSERT INTO "products" ("cant_think_of_a_sensible_time_field", "name", "price", "published_at", "released_on", "some_value_with_default", "times_sold", "weight") VALUES (NULL, NULL, NULL, NULL, NULL, 0.0, NULL, 10.0) diff --git a/test/delocalize_test.rb b/test/delocalize_test.rb index c942bfa..22dc335 100644 --- a/test/delocalize_test.rb +++ b/test/delocalize_test.rb @@ -238,9 +238,11 @@ def setup end test "doesn't convert the value if field has errors" do + error_class = Rails.version =~ /^3/ ? 'field_with_errors' : 'fieldWithErrors' + @product = ProductWithValidation.new(:price => 'this is not a number') @product.valid? - assert_dom_equal '
', + assert_dom_equal %(
), text_field(:product, :price) end diff --git a/test/rails_app/app/controllers/application_controller.rb b/test/rails2_app/app/controllers/application_controller.rb similarity index 100% rename from test/rails_app/app/controllers/application_controller.rb rename to test/rails2_app/app/controllers/application_controller.rb diff --git a/test/rails_app/config/boot.rb b/test/rails2_app/config/boot.rb similarity index 100% rename from test/rails_app/config/boot.rb rename to test/rails2_app/config/boot.rb diff --git a/test/rails_app/config/database.yml b/test/rails2_app/config/database.yml similarity index 100% rename from test/rails_app/config/database.yml rename to test/rails2_app/config/database.yml diff --git a/test/rails_app/config/environment.rb b/test/rails2_app/config/environment.rb similarity index 91% rename from test/rails_app/config/environment.rb rename to test/rails2_app/config/environment.rb index bd0d525..16e3e78 100644 --- a/test/rails_app/config/environment.rb +++ b/test/rails2_app/config/environment.rb @@ -1,7 +1,7 @@ # 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.5' unless defined? RAILS_GEM_VERSION +RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') diff --git a/test/rails_app/config/environments/test.rb b/test/rails2_app/config/environments/test.rb similarity index 100% rename from test/rails_app/config/environments/test.rb rename to test/rails2_app/config/environments/test.rb diff --git a/test/rails_app/config/initializers/new_rails_defaults.rb b/test/rails2_app/config/initializers/new_rails_defaults.rb similarity index 100% rename from test/rails_app/config/initializers/new_rails_defaults.rb rename to test/rails2_app/config/initializers/new_rails_defaults.rb diff --git a/test/rails_app/config/initializers/session_store.rb b/test/rails2_app/config/initializers/session_store.rb similarity index 100% rename from test/rails_app/config/initializers/session_store.rb rename to test/rails2_app/config/initializers/session_store.rb diff --git a/test/rails_app/config/routes.rb b/test/rails2_app/config/routes.rb similarity index 100% rename from test/rails_app/config/routes.rb rename to test/rails2_app/config/routes.rb diff --git a/test/rails2_app/log/test.log b/test/rails2_app/log/test.log new file mode 100644 index 0000000..26aebef --- /dev/null +++ b/test/rails2_app/log/test.log @@ -0,0 +1,119 @@ +# Logfile created on Sun Jan 17 23:07:09 +0100 2010 SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer)  + Product Create (0.2ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer)  + Product Create (0.2ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer)  + Product Create (0.3ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.5ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.5ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer)  + Product Create (0.2ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 10.0, NULL) + SQL (0.3ms) select sqlite_version(*) + SQL (0.5ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.5ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.3ms) select sqlite_version(*) + SQL (0.6ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.3ms) select sqlite_version(*) + SQL (0.6ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.5ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.2ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.5ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.3ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) + SQL (0.2ms) select sqlite_version(*) + SQL (0.4ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "released_on" date, "published_at" datetime, "cant_think_of_a_sensible_time_field" time, "price" decimal, "weight" float, "times_sold" integer, "some_value_with_default" decimal(20,2) DEFAULT 0)  + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, 10.0, NULL, NULL, NULL, 0.0, NULL, NULL) + Product Create (0.1ms) INSERT INTO "products" ("name", "price", "cant_think_of_a_sensible_time_field", "times_sold", "released_on", "some_value_with_default", "weight", "published_at") VALUES(NULL, NULL, NULL, NULL, NULL, 0.0, 10.0, NULL) diff --git a/test/rails_app/vendor/plugins/delocalize b/test/rails2_app/vendor/plugins/delocalize similarity index 100% rename from test/rails_app/vendor/plugins/delocalize rename to test/rails2_app/vendor/plugins/delocalize diff --git a/test/rails3_app/.gitignore b/test/rails3_app/.gitignore new file mode 100644 index 0000000..af64fae --- /dev/null +++ b/test/rails3_app/.gitignore @@ -0,0 +1,4 @@ +.bundle +db/*.sqlite3 +log/*.log +tmp/**/* diff --git a/test/rails3_app/Gemfile b/test/rails3_app/Gemfile new file mode 100644 index 0000000..63a2bf4 --- /dev/null +++ b/test/rails3_app/Gemfile @@ -0,0 +1,5 @@ +source 'http://rubygems.org' + +gem 'rails', '3.0.0' +gem 'sqlite3-ruby', :require => 'sqlite3' +gem 'delocalize', :path => '../../' diff --git a/test/rails3_app/Gemfile.lock b/test/rails3_app/Gemfile.lock new file mode 100644 index 0000000..2826b9e --- /dev/null +++ b/test/rails3_app/Gemfile.lock @@ -0,0 +1,79 @@ +PATH + remote: /Users/clemens/.repositories/delocalize + specs: + delocalize (0.2.2) + +GEM + remote: http://rubygems.org/ + specs: + abstract (1.0.0) + actionmailer (3.0.0) + actionpack (= 3.0.0) + mail (~> 2.2.5) + actionpack (3.0.0) + activemodel (= 3.0.0) + activesupport (= 3.0.0) + builder (~> 2.1.2) + erubis (~> 2.6.6) + i18n (~> 0.4.1) + rack (~> 1.2.1) + rack-mount (~> 0.6.12) + rack-test (~> 0.5.4) + tzinfo (~> 0.3.23) + activemodel (3.0.0) + activesupport (= 3.0.0) + builder (~> 2.1.2) + i18n (~> 0.4.1) + activerecord (3.0.0) + activemodel (= 3.0.0) + activesupport (= 3.0.0) + arel (~> 1.0.0) + tzinfo (~> 0.3.23) + activeresource (3.0.0) + activemodel (= 3.0.0) + activesupport (= 3.0.0) + activesupport (3.0.0) + arel (1.0.1) + activesupport (~> 3.0.0) + builder (2.1.2) + erubis (2.6.6) + abstract (>= 1.0.0) + i18n (0.4.1) + mail (2.2.6) + activesupport (>= 2.3.6) + mime-types + treetop (>= 1.4.5) + mime-types (1.16) + polyglot (0.3.1) + rack (1.2.1) + rack-mount (0.6.13) + rack (>= 1.0.0) + rack-test (0.5.4) + rack (>= 1.0) + rails (3.0.0) + actionmailer (= 3.0.0) + actionpack (= 3.0.0) + activerecord (= 3.0.0) + activeresource (= 3.0.0) + activesupport (= 3.0.0) + bundler (~> 1.0.0) + railties (= 3.0.0) + railties (3.0.0) + actionpack (= 3.0.0) + activesupport (= 3.0.0) + rake (>= 0.8.4) + thor (~> 0.14.0) + rake (0.8.7) + sqlite3-ruby (1.2.5) + thor (0.14.0) + treetop (1.4.8) + polyglot (>= 0.3.1) + tzinfo (0.3.23) + +PLATFORMS + ruby + +DEPENDENCIES + delocalize! + rails (= 3.0.0) + sqlite3-ruby diff --git a/test/rails3_app/app/controllers/application_controller.rb b/test/rails3_app/app/controllers/application_controller.rb new file mode 100644 index 0000000..e8065d9 --- /dev/null +++ b/test/rails3_app/app/controllers/application_controller.rb @@ -0,0 +1,3 @@ +class ApplicationController < ActionController::Base + protect_from_forgery +end diff --git a/test/rails3_app/app/helpers/application_helper.rb b/test/rails3_app/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/test/rails3_app/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/test/rails3_app/app/views/layouts/application.html.erb b/test/rails3_app/app/views/layouts/application.html.erb new file mode 100644 index 0000000..491864d --- /dev/null +++ b/test/rails3_app/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + Rails3App + <%= stylesheet_link_tag :all %> + <%= javascript_include_tag :defaults %> + <%= csrf_meta_tag %> + + + +<%= yield %> + + + diff --git a/test/rails3_app/config/application.rb b/test/rails3_app/config/application.rb new file mode 100644 index 0000000..b36adea --- /dev/null +++ b/test/rails3_app/config/application.rb @@ -0,0 +1,44 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +# If you have a Gemfile, require the gems listed there, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(:default, Rails.env) if defined?(Bundler) + +module Rails3App + class Application < Rails::Application + # 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. + + # Custom directories with classes and modules you want to be autoloadable. + # config.autoload_paths += %W(#{config.root}/extras) + + # 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 ] + + # 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. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # 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}').to_s] + # config.i18n.default_locale = :de + + # JavaScript files you want as :defaults (application.js is always included). + # config.action_view.javascript_expansions[:defaults] = %w(jquery rails) + + config.paths.config.database = File.expand_path(File.dirname(__FILE__) + '../../../database.yml') + + # Configure the default encoding used in templates for Ruby 1.9. + config.encoding = "utf-8" + + # Configure sensitive parameters which will be filtered from the log file. + config.filter_parameters += [:password] + end +end diff --git a/test/rails3_app/config/boot.rb b/test/rails3_app/config/boot.rb new file mode 100644 index 0000000..ab6cb37 --- /dev/null +++ b/test/rails3_app/config/boot.rb @@ -0,0 +1,13 @@ +require 'rubygems' + +# Set up gems listed in the Gemfile. +gemfile = File.expand_path('../../Gemfile', __FILE__) +begin + ENV['BUNDLE_GEMFILE'] = gemfile + require 'bundler' + Bundler.setup +rescue Bundler::GemNotFound => e + STDERR.puts e.message + STDERR.puts "Try running `bundle install`." + exit! +end if File.exist?(gemfile) diff --git a/test/rails3_app/config/database.yml b/test/rails3_app/config/database.yml new file mode 100644 index 0000000..2cfeb7a --- /dev/null +++ b/test/rails3_app/config/database.yml @@ -0,0 +1,3 @@ +test: + adapter: sqlite3 + database: ":memory:" diff --git a/test/rails3_app/config/environment.rb b/test/rails3_app/config/environment.rb new file mode 100644 index 0000000..6c69232 --- /dev/null +++ b/test/rails3_app/config/environment.rb @@ -0,0 +1,5 @@ +# Load the rails application +require File.expand_path('../application', __FILE__) + +# Initialize the rails application +Rails3App::Application.initialize! diff --git a/test/rails3_app/config/environments/test.rb b/test/rails3_app/config/environments/test.rb new file mode 100644 index 0000000..75cecda --- /dev/null +++ b/test/rails3_app/config/environments/test.rb @@ -0,0 +1,35 @@ +Rails3App::Application.configure do + # 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.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates + config.action_dispatch.show_exceptions = false + + # 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 + + # Print deprecation notices to the stderr + config.active_support.deprecation = :stderr +end diff --git a/test/test_helper.rb b/test/test_helper.rb index 70920d8..b727550 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,14 +1,15 @@ # encoding: utf-8 ENV["RAILS_ENV"] = "test" -require File.expand_path(File.join(File.dirname(__FILE__), 'rails_app/config/environment')) -require 'test_help' +rails_version = ENV["RAILS_VERSION"] || 2 -require 'rubygems' -require 'active_record' -require 'active_record/test_case' -require 'action_view' -require 'action_view/test_case' +if rails_version.to_i == 2 + require File.expand_path(File.join(File.dirname(__FILE__), "rails2_app/config/environment")) + require 'test_help' +else + require File.expand_path(File.join(File.dirname(__FILE__), "rails3_app/config/environment")) + require 'rails/test_help' +end I18n.backend.store_translations :de, { :date => {