diff --git a/.gitignore b/.gitignore
index cd52aca..83106fd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
.bundle/
+.idea/
log/*.log
pkg/
Gemfile.lock
diff --git a/.travis.yml b/.travis.yml
index 37e7e91..5183ddb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,15 +1,19 @@
+language: ruby
rvm:
- - 1.9.2
- - 1.9.3
- - 2.0.0
-env:
- - "RAILS_VERSION=3.1.0"
- - "RAILS_VERSION=3.2.0"
- - "RAILS_VERSION=4.0.0"
+ - 2.3.8
+ - 2.4.9
+ - 2.5
+ - 2.6
+gemfile:
+ - gemfiles/rails_4.1.gemfile
+ - gemfiles/rails_4.2.gemfile
+ - gemfiles/rails_5.0.gemfile
+ - gemfiles/rails_5.1.gemfile
+ - gemfiles/rails_5.2.gemfile
+ - gemfiles/rails_6.0.gemfile
matrix:
exclude:
- - rvm: 1.9.2
- env: "RAILS_VERSION=4.0.0"
-branches:
- only:
- - master
+ - rvm: 2.3.8
+ gemfile: gemfiles/rails_6.0.gemfile
+ - rvm: 2.4.9
+ gemfile: gemfiles/rails_6.0.gemfile
diff --git a/Appraisals b/Appraisals
index 635f8c4..3fd2ee3 100644
--- a/Appraisals
+++ b/Appraisals
@@ -1,7 +1,35 @@
-appraise "rails-3" do
- gem "rails", "~> 3.2"
+appraise "rails-4.1" do
+ gem "rails", "~> 4.1.0"
+ gem 'test-unit', '~> 3.0'
+ gem 'sprockets', '~> 3.7'
end
-appraise "rails-4" do
- gem "rails", "~> 4.0"
+appraise "rails-4.2" do
+ gem "rails", "~> 4.2.0"
+ gem 'test-unit', '~> 3.0'
+ gem 'sprockets', '~> 3.7'
+end
+
+appraise "rails-5.0" do
+ gem "rails", "~> 5.0.0"
+ gem 'test-unit', '~> 3.0'
+ gem 'sprockets', '~> 3.7'
+end
+
+appraise "rails-5.1" do
+ gem "rails", "~> 5.1.0"
+ gem 'test-unit', '~> 3.0'
+ gem 'sprockets', '~> 3.7'
+end
+
+appraise "rails-5.2" do
+ gem "rails", "~> 5.2.0"
+ gem 'test-unit', '~> 3.0'
+ gem 'sprockets', '~> 3.7'
+end
+
+appraise "rails-6.0" do
+ gem "rails", "~> 6.0.0"
+ gem 'test-unit', '~> 3.0'
+ gem 'sprockets', '~> 4.0'
end
diff --git a/Gemfile b/Gemfile
index 5f6e3ae..745593c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,5 +2,4 @@ source "http://rubygems.org"
gemspec
-gem 'appraisal', "1.0.0.beta3"
-gem "debugger"
+gem 'appraisal', "2.2.0"
diff --git a/carmen-rails.gemspec b/carmen-rails.gemspec
index 6113faa..f2c0240 100644
--- a/carmen-rails.gemspec
+++ b/carmen-rails.gemspec
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
s.test_files = Dir["spec/**/*"]
s.add_dependency "rails"
- s.add_dependency "carmen", "~> 1.0.0"
+ s.add_dependency "carmen", "~> 1.0"
s.add_development_dependency "minitest"
end
diff --git a/gemfiles/rails_3.gemfile b/gemfiles/rails_3.gemfile
deleted file mode 100644
index 6bfabe4..0000000
--- a/gemfiles/rails_3.gemfile
+++ /dev/null
@@ -1,9 +0,0 @@
-# This file was generated by Appraisal
-
-source "http://rubygems.org"
-
-gem "appraisal", "1.0.0.beta3"
-gem "debugger"
-gem "rails", "~> 3.2"
-
-gemspec :path=>".././"
diff --git a/gemfiles/rails_3.gemfile.lock b/gemfiles/rails_3.gemfile.lock
deleted file mode 100644
index 38b8af7..0000000
--- a/gemfiles/rails_3.gemfile.lock
+++ /dev/null
@@ -1,111 +0,0 @@
-PATH
- remote: .././
- specs:
- carmen-rails (1.0.0)
- carmen (~> 1.0.0)
- rails
-
-GEM
- remote: http://rubygems.org/
- specs:
- actionmailer (3.2.17)
- actionpack (= 3.2.17)
- mail (~> 2.5.4)
- actionpack (3.2.17)
- activemodel (= 3.2.17)
- activesupport (= 3.2.17)
- builder (~> 3.0.0)
- erubis (~> 2.7.0)
- journey (~> 1.0.4)
- rack (~> 1.4.5)
- rack-cache (~> 1.2)
- rack-test (~> 0.6.1)
- sprockets (~> 2.2.1)
- activemodel (3.2.17)
- activesupport (= 3.2.17)
- builder (~> 3.0.0)
- activerecord (3.2.17)
- activemodel (= 3.2.17)
- activesupport (= 3.2.17)
- arel (~> 3.0.2)
- tzinfo (~> 0.3.29)
- activeresource (3.2.17)
- activemodel (= 3.2.17)
- activesupport (= 3.2.17)
- activesupport (3.2.17)
- i18n (~> 0.6, >= 0.6.4)
- multi_json (~> 1.0)
- appraisal (1.0.0.beta3)
- bundler
- rake
- thor (>= 0.14.0)
- arel (3.0.3)
- builder (3.0.4)
- carmen (1.0.1)
- unicode_utils (~> 1.4.0)
- columnize (0.3.6)
- debugger (1.6.6)
- columnize (>= 0.3.1)
- debugger-linecache (~> 1.2.0)
- debugger-ruby_core_source (~> 1.3.2)
- debugger-linecache (1.2.0)
- debugger-ruby_core_source (1.3.2)
- erubis (2.7.0)
- hike (1.2.3)
- i18n (0.6.9)
- journey (1.0.4)
- json (1.8.1)
- mail (2.5.4)
- mime-types (~> 1.16)
- treetop (~> 1.4.8)
- mime-types (1.25.1)
- minitest (5.3.0)
- multi_json (1.9.0)
- polyglot (0.3.4)
- rack (1.4.5)
- rack-cache (1.2)
- rack (>= 0.4)
- rack-ssl (1.3.3)
- rack
- rack-test (0.6.2)
- rack (>= 1.0)
- rails (3.2.17)
- actionmailer (= 3.2.17)
- actionpack (= 3.2.17)
- activerecord (= 3.2.17)
- activeresource (= 3.2.17)
- activesupport (= 3.2.17)
- bundler (~> 1.0)
- railties (= 3.2.17)
- railties (3.2.17)
- actionpack (= 3.2.17)
- activesupport (= 3.2.17)
- rack-ssl (~> 1.3.2)
- rake (>= 0.8.7)
- rdoc (~> 3.4)
- thor (>= 0.14.6, < 2.0)
- rake (10.1.1)
- rdoc (3.12.2)
- json (~> 1.4)
- sprockets (2.2.2)
- hike (~> 1.2)
- multi_json (~> 1.0)
- rack (~> 1.0)
- tilt (~> 1.1, != 1.3.0)
- thor (0.18.1)
- tilt (1.4.1)
- treetop (1.4.15)
- polyglot
- polyglot (>= 0.3.1)
- tzinfo (0.3.38)
- unicode_utils (1.4.0)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- appraisal (= 1.0.0.beta3)
- carmen-rails!
- debugger
- minitest
- rails (~> 3.2)
diff --git a/gemfiles/rails_4.1.gemfile b/gemfiles/rails_4.1.gemfile
new file mode 100644
index 0000000..6b3a871
--- /dev/null
+++ b/gemfiles/rails_4.1.gemfile
@@ -0,0 +1,10 @@
+# This file was generated by Appraisal
+
+source "http://rubygems.org"
+
+gem "appraisal", "2.2.0"
+gem "rails", "~> 4.1.0"
+gem "test-unit", "~> 3.0"
+gem "sprockets", "~> 3.7"
+
+gemspec path: "../"
diff --git a/gemfiles/rails_4.1.gemfile.lock b/gemfiles/rails_4.1.gemfile.lock
new file mode 100644
index 0000000..c98716a
--- /dev/null
+++ b/gemfiles/rails_4.1.gemfile.lock
@@ -0,0 +1,100 @@
+PATH
+ remote: ..
+ specs:
+ carmen-rails (1.0.1)
+ carmen (~> 1.0)
+ rails
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (4.1.16)
+ actionpack (= 4.1.16)
+ actionview (= 4.1.16)
+ mail (~> 2.5, >= 2.5.4)
+ actionpack (4.1.16)
+ actionview (= 4.1.16)
+ activesupport (= 4.1.16)
+ rack (~> 1.5.2)
+ rack-test (~> 0.6.2)
+ actionview (4.1.16)
+ activesupport (= 4.1.16)
+ builder (~> 3.1)
+ erubis (~> 2.7.0)
+ activemodel (4.1.16)
+ activesupport (= 4.1.16)
+ builder (~> 3.1)
+ activerecord (4.1.16)
+ activemodel (= 4.1.16)
+ activesupport (= 4.1.16)
+ arel (~> 5.0.0)
+ activesupport (4.1.16)
+ i18n (~> 0.6, >= 0.6.9)
+ json (~> 1.7, >= 1.7.7)
+ minitest (~> 5.1)
+ thread_safe (~> 0.1)
+ tzinfo (~> 1.1)
+ appraisal (2.2.0)
+ bundler
+ rake
+ thor (>= 0.14.0)
+ arel (5.0.1.20140414130214)
+ builder (3.2.3)
+ carmen (1.1.3)
+ activesupport (>= 3.0.0)
+ concurrent-ruby (1.1.5)
+ erubis (2.7.0)
+ i18n (0.9.5)
+ concurrent-ruby (~> 1.0)
+ json (1.8.6)
+ mail (2.7.1)
+ mini_mime (>= 0.1.1)
+ mini_mime (1.0.2)
+ minitest (5.13.0)
+ power_assert (1.1.5)
+ rack (1.5.5)
+ rack-test (0.6.3)
+ rack (>= 1.0)
+ rails (4.1.16)
+ actionmailer (= 4.1.16)
+ actionpack (= 4.1.16)
+ actionview (= 4.1.16)
+ activemodel (= 4.1.16)
+ activerecord (= 4.1.16)
+ activesupport (= 4.1.16)
+ bundler (>= 1.3.0, < 2.0)
+ railties (= 4.1.16)
+ sprockets-rails (~> 2.0)
+ railties (4.1.16)
+ actionpack (= 4.1.16)
+ activesupport (= 4.1.16)
+ rake (>= 0.8.7)
+ thor (>= 0.18.1, < 2.0)
+ rake (13.0.0)
+ sprockets (3.7.2)
+ concurrent-ruby (~> 1.0)
+ rack (> 1, < 3)
+ sprockets-rails (2.3.3)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ sprockets (>= 2.8, < 4.0)
+ test-unit (3.3.4)
+ power_assert
+ thor (0.20.3)
+ thread_safe (0.3.6)
+ tzinfo (1.2.5)
+ thread_safe (~> 0.1)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ appraisal (= 2.2.0)
+ carmen-rails!
+ minitest
+ rails (~> 4.1.0)
+ sprockets (~> 3.7)
+ test-unit (~> 3.0)
+
+BUNDLED WITH
+ 1.17.2
diff --git a/gemfiles/rails_4.2.gemfile b/gemfiles/rails_4.2.gemfile
new file mode 100644
index 0000000..8ebcd76
--- /dev/null
+++ b/gemfiles/rails_4.2.gemfile
@@ -0,0 +1,10 @@
+# This file was generated by Appraisal
+
+source "http://rubygems.org"
+
+gem "appraisal", "2.2.0"
+gem "rails", "~> 4.2.0"
+gem "test-unit", "~> 3.0"
+gem "sprockets", "~> 3.7"
+
+gemspec path: "../"
diff --git a/gemfiles/rails_4.2.gemfile.lock b/gemfiles/rails_4.2.gemfile.lock
new file mode 100644
index 0000000..6414cb4
--- /dev/null
+++ b/gemfiles/rails_4.2.gemfile.lock
@@ -0,0 +1,125 @@
+PATH
+ remote: ..
+ specs:
+ carmen-rails (1.0.1)
+ carmen (~> 1.0)
+ rails
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (4.2.10)
+ actionpack (= 4.2.10)
+ actionview (= 4.2.10)
+ activejob (= 4.2.10)
+ mail (~> 2.5, >= 2.5.4)
+ rails-dom-testing (~> 1.0, >= 1.0.5)
+ actionpack (4.2.10)
+ actionview (= 4.2.10)
+ activesupport (= 4.2.10)
+ rack (~> 1.6)
+ rack-test (~> 0.6.2)
+ rails-dom-testing (~> 1.0, >= 1.0.5)
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
+ actionview (4.2.10)
+ activesupport (= 4.2.10)
+ builder (~> 3.1)
+ erubis (~> 2.7.0)
+ rails-dom-testing (~> 1.0, >= 1.0.5)
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
+ activejob (4.2.10)
+ activesupport (= 4.2.10)
+ globalid (>= 0.3.0)
+ activemodel (4.2.10)
+ activesupport (= 4.2.10)
+ builder (~> 3.1)
+ activerecord (4.2.10)
+ activemodel (= 4.2.10)
+ activesupport (= 4.2.10)
+ arel (~> 6.0)
+ activesupport (4.2.10)
+ i18n (~> 0.7)
+ minitest (~> 5.1)
+ thread_safe (~> 0.3, >= 0.3.4)
+ tzinfo (~> 1.1)
+ appraisal (2.2.0)
+ bundler
+ rake
+ thor (>= 0.14.0)
+ arel (6.0.4)
+ builder (3.2.3)
+ carmen (1.1.3)
+ activesupport (>= 3.0.0)
+ concurrent-ruby (1.1.5)
+ crass (1.0.5)
+ erubis (2.7.0)
+ globalid (0.4.2)
+ activesupport (>= 4.2.0)
+ i18n (0.9.5)
+ concurrent-ruby (~> 1.0)
+ loofah (2.3.1)
+ crass (~> 1.0.2)
+ nokogiri (>= 1.5.9)
+ mail (2.7.1)
+ mini_mime (>= 0.1.1)
+ mini_mime (1.0.2)
+ mini_portile2 (2.4.0)
+ minitest (5.13.0)
+ nokogiri (1.10.4)
+ mini_portile2 (~> 2.4.0)
+ power_assert (1.1.5)
+ rack (1.6.11)
+ rack-test (0.6.3)
+ rack (>= 1.0)
+ rails (4.2.10)
+ actionmailer (= 4.2.10)
+ actionpack (= 4.2.10)
+ actionview (= 4.2.10)
+ activejob (= 4.2.10)
+ activemodel (= 4.2.10)
+ activerecord (= 4.2.10)
+ activesupport (= 4.2.10)
+ bundler (>= 1.3.0, < 2.0)
+ railties (= 4.2.10)
+ sprockets-rails
+ rails-deprecated_sanitizer (1.0.3)
+ activesupport (>= 4.2.0.alpha)
+ rails-dom-testing (1.0.9)
+ activesupport (>= 4.2.0, < 5.0)
+ nokogiri (~> 1.6)
+ rails-deprecated_sanitizer (>= 1.0.1)
+ rails-html-sanitizer (1.3.0)
+ loofah (~> 2.3)
+ railties (4.2.10)
+ actionpack (= 4.2.10)
+ activesupport (= 4.2.10)
+ rake (>= 0.8.7)
+ thor (>= 0.18.1, < 2.0)
+ rake (13.0.0)
+ sprockets (3.7.2)
+ concurrent-ruby (~> 1.0)
+ rack (> 1, < 3)
+ sprockets-rails (3.2.1)
+ actionpack (>= 4.0)
+ activesupport (>= 4.0)
+ sprockets (>= 3.0.0)
+ test-unit (3.3.4)
+ power_assert
+ thor (0.20.3)
+ thread_safe (0.3.6)
+ tzinfo (1.2.5)
+ thread_safe (~> 0.1)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ appraisal (= 2.2.0)
+ carmen-rails!
+ minitest
+ rails (~> 4.2.0)
+ sprockets (~> 3.7)
+ test-unit (~> 3.0)
+
+BUNDLED WITH
+ 1.17.2
diff --git a/gemfiles/rails_4.gemfile b/gemfiles/rails_4.gemfile
deleted file mode 100644
index e76d38f..0000000
--- a/gemfiles/rails_4.gemfile
+++ /dev/null
@@ -1,9 +0,0 @@
-# This file was generated by Appraisal
-
-source "http://rubygems.org"
-
-gem "appraisal", "1.0.0.beta3"
-gem "debugger"
-gem "rails", "~> 4.0"
-
-gemspec :path=>".././"
diff --git a/gemfiles/rails_4.gemfile.lock b/gemfiles/rails_4.gemfile.lock
deleted file mode 100644
index f9c5048..0000000
--- a/gemfiles/rails_4.gemfile.lock
+++ /dev/null
@@ -1,105 +0,0 @@
-PATH
- remote: .././
- specs:
- carmen-rails (1.0.0)
- carmen (~> 1.0.0)
- rails
-
-GEM
- remote: http://rubygems.org/
- specs:
- actionmailer (4.0.3)
- actionpack (= 4.0.3)
- mail (~> 2.5.4)
- actionpack (4.0.3)
- activesupport (= 4.0.3)
- builder (~> 3.1.0)
- erubis (~> 2.7.0)
- rack (~> 1.5.2)
- rack-test (~> 0.6.2)
- activemodel (4.0.3)
- activesupport (= 4.0.3)
- builder (~> 3.1.0)
- activerecord (4.0.3)
- activemodel (= 4.0.3)
- activerecord-deprecated_finders (~> 1.0.2)
- activesupport (= 4.0.3)
- arel (~> 4.0.0)
- activerecord-deprecated_finders (1.0.3)
- activesupport (4.0.3)
- i18n (~> 0.6, >= 0.6.4)
- minitest (~> 4.2)
- multi_json (~> 1.3)
- thread_safe (~> 0.1)
- tzinfo (~> 0.3.37)
- appraisal (1.0.0.beta3)
- bundler
- rake
- thor (>= 0.14.0)
- arel (4.0.2)
- atomic (1.1.15)
- builder (3.1.4)
- carmen (1.0.1)
- unicode_utils (~> 1.4.0)
- columnize (0.3.6)
- debugger (1.6.6)
- columnize (>= 0.3.1)
- debugger-linecache (~> 1.2.0)
- debugger-ruby_core_source (~> 1.3.2)
- debugger-linecache (1.2.0)
- debugger-ruby_core_source (1.3.2)
- erubis (2.7.0)
- hike (1.2.3)
- i18n (0.6.9)
- mail (2.5.4)
- mime-types (~> 1.16)
- treetop (~> 1.4.8)
- mime-types (1.25.1)
- minitest (4.7.5)
- multi_json (1.9.0)
- polyglot (0.3.4)
- rack (1.5.2)
- rack-test (0.6.2)
- rack (>= 1.0)
- rails (4.0.3)
- actionmailer (= 4.0.3)
- actionpack (= 4.0.3)
- activerecord (= 4.0.3)
- activesupport (= 4.0.3)
- bundler (>= 1.3.0, < 2.0)
- railties (= 4.0.3)
- sprockets-rails (~> 2.0.0)
- railties (4.0.3)
- actionpack (= 4.0.3)
- activesupport (= 4.0.3)
- rake (>= 0.8.7)
- thor (>= 0.18.1, < 2.0)
- rake (10.1.1)
- sprockets (2.11.0)
- hike (~> 1.2)
- multi_json (~> 1.0)
- rack (~> 1.0)
- tilt (~> 1.1, != 1.3.0)
- sprockets-rails (2.0.1)
- actionpack (>= 3.0)
- activesupport (>= 3.0)
- sprockets (~> 2.8)
- thor (0.18.1)
- thread_safe (0.2.0)
- atomic (>= 1.1.7, < 2)
- tilt (1.4.1)
- treetop (1.4.15)
- polyglot
- polyglot (>= 0.3.1)
- tzinfo (0.3.38)
- unicode_utils (1.4.0)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- appraisal (= 1.0.0.beta3)
- carmen-rails!
- debugger
- minitest
- rails (~> 4.0)
diff --git a/gemfiles/rails_5.0.gemfile b/gemfiles/rails_5.0.gemfile
new file mode 100644
index 0000000..2405dbb
--- /dev/null
+++ b/gemfiles/rails_5.0.gemfile
@@ -0,0 +1,10 @@
+# This file was generated by Appraisal
+
+source "http://rubygems.org"
+
+gem "appraisal", "2.2.0"
+gem "rails", "~> 5.0.0"
+gem "test-unit", "~> 3.0"
+gem "sprockets", "~> 3.7"
+
+gemspec path: "../"
diff --git a/gemfiles/rails_5.0.gemfile.lock b/gemfiles/rails_5.0.gemfile.lock
new file mode 100644
index 0000000..26374ef
--- /dev/null
+++ b/gemfiles/rails_5.0.gemfile.lock
@@ -0,0 +1,132 @@
+PATH
+ remote: ..
+ specs:
+ carmen-rails (1.0.1)
+ carmen (~> 1.0)
+ rails
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actioncable (5.0.1)
+ actionpack (= 5.0.1)
+ nio4r (~> 1.2)
+ websocket-driver (~> 0.6.1)
+ actionmailer (5.0.1)
+ actionpack (= 5.0.1)
+ actionview (= 5.0.1)
+ activejob (= 5.0.1)
+ mail (~> 2.5, >= 2.5.4)
+ rails-dom-testing (~> 2.0)
+ actionpack (5.0.1)
+ actionview (= 5.0.1)
+ activesupport (= 5.0.1)
+ rack (~> 2.0)
+ rack-test (~> 0.6.3)
+ rails-dom-testing (~> 2.0)
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
+ actionview (5.0.1)
+ activesupport (= 5.0.1)
+ builder (~> 3.1)
+ erubis (~> 2.7.0)
+ rails-dom-testing (~> 2.0)
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
+ activejob (5.0.1)
+ activesupport (= 5.0.1)
+ globalid (>= 0.3.6)
+ activemodel (5.0.1)
+ activesupport (= 5.0.1)
+ activerecord (5.0.1)
+ activemodel (= 5.0.1)
+ activesupport (= 5.0.1)
+ arel (~> 7.0)
+ activesupport (5.0.1)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
+ i18n (~> 0.7)
+ minitest (~> 5.1)
+ tzinfo (~> 1.1)
+ appraisal (2.2.0)
+ bundler
+ rake
+ thor (>= 0.14.0)
+ arel (7.1.4)
+ builder (3.2.3)
+ carmen (1.1.3)
+ activesupport (>= 3.0.0)
+ concurrent-ruby (1.1.5)
+ crass (1.0.5)
+ erubis (2.7.0)
+ globalid (0.4.2)
+ activesupport (>= 4.2.0)
+ i18n (0.9.5)
+ concurrent-ruby (~> 1.0)
+ loofah (2.3.1)
+ crass (~> 1.0.2)
+ nokogiri (>= 1.5.9)
+ mail (2.7.1)
+ mini_mime (>= 0.1.1)
+ method_source (0.9.2)
+ mini_mime (1.0.2)
+ mini_portile2 (2.4.0)
+ minitest (5.13.0)
+ nio4r (1.2.1)
+ nokogiri (1.10.4)
+ mini_portile2 (~> 2.4.0)
+ power_assert (1.1.5)
+ rack (2.0.7)
+ rack-test (0.6.3)
+ rack (>= 1.0)
+ rails (5.0.1)
+ actioncable (= 5.0.1)
+ actionmailer (= 5.0.1)
+ actionpack (= 5.0.1)
+ actionview (= 5.0.1)
+ activejob (= 5.0.1)
+ activemodel (= 5.0.1)
+ activerecord (= 5.0.1)
+ activesupport (= 5.0.1)
+ bundler (>= 1.3.0, < 2.0)
+ railties (= 5.0.1)
+ sprockets-rails (>= 2.0.0)
+ rails-dom-testing (2.0.3)
+ activesupport (>= 4.2.0)
+ nokogiri (>= 1.6)
+ rails-html-sanitizer (1.3.0)
+ loofah (~> 2.3)
+ railties (5.0.1)
+ actionpack (= 5.0.1)
+ activesupport (= 5.0.1)
+ method_source
+ rake (>= 0.8.7)
+ thor (>= 0.18.1, < 2.0)
+ rake (13.0.0)
+ sprockets (3.7.2)
+ concurrent-ruby (~> 1.0)
+ rack (> 1, < 3)
+ sprockets-rails (3.2.1)
+ actionpack (>= 4.0)
+ activesupport (>= 4.0)
+ sprockets (>= 3.0.0)
+ test-unit (3.3.4)
+ power_assert
+ thor (0.20.3)
+ thread_safe (0.3.6)
+ tzinfo (1.2.5)
+ thread_safe (~> 0.1)
+ websocket-driver (0.6.5)
+ websocket-extensions (>= 0.1.0)
+ websocket-extensions (0.1.4)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ appraisal (= 2.2.0)
+ carmen-rails!
+ minitest
+ rails (~> 5.0.0)
+ sprockets (~> 3.7)
+ test-unit (~> 3.0)
+
+BUNDLED WITH
+ 1.17.2
diff --git a/gemfiles/rails_5.1.gemfile b/gemfiles/rails_5.1.gemfile
new file mode 100644
index 0000000..3b77cf4
--- /dev/null
+++ b/gemfiles/rails_5.1.gemfile
@@ -0,0 +1,10 @@
+# This file was generated by Appraisal
+
+source "http://rubygems.org"
+
+gem "appraisal", "2.2.0"
+gem "rails", "~> 5.1.0"
+gem "test-unit", "~> 3.0"
+gem "sprockets", "~> 3.7"
+
+gemspec path: "../"
diff --git a/gemfiles/rails_5.1.gemfile.lock b/gemfiles/rails_5.1.gemfile.lock
new file mode 100644
index 0000000..c3760a2
--- /dev/null
+++ b/gemfiles/rails_5.1.gemfile.lock
@@ -0,0 +1,132 @@
+PATH
+ remote: ..
+ specs:
+ carmen-rails (1.0.1)
+ carmen (~> 1.0)
+ rails
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actioncable (5.1.7)
+ actionpack (= 5.1.7)
+ nio4r (~> 2.0)
+ websocket-driver (~> 0.6.1)
+ actionmailer (5.1.7)
+ actionpack (= 5.1.7)
+ actionview (= 5.1.7)
+ activejob (= 5.1.7)
+ mail (~> 2.5, >= 2.5.4)
+ rails-dom-testing (~> 2.0)
+ actionpack (5.1.7)
+ actionview (= 5.1.7)
+ activesupport (= 5.1.7)
+ rack (~> 2.0)
+ rack-test (>= 0.6.3)
+ rails-dom-testing (~> 2.0)
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
+ actionview (5.1.7)
+ activesupport (= 5.1.7)
+ builder (~> 3.1)
+ erubi (~> 1.4)
+ rails-dom-testing (~> 2.0)
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
+ activejob (5.1.7)
+ activesupport (= 5.1.7)
+ globalid (>= 0.3.6)
+ activemodel (5.1.7)
+ activesupport (= 5.1.7)
+ activerecord (5.1.7)
+ activemodel (= 5.1.7)
+ activesupport (= 5.1.7)
+ arel (~> 8.0)
+ activesupport (5.1.7)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
+ i18n (>= 0.7, < 2)
+ minitest (~> 5.1)
+ tzinfo (~> 1.1)
+ appraisal (2.2.0)
+ bundler
+ rake
+ thor (>= 0.14.0)
+ arel (8.0.0)
+ builder (3.2.3)
+ carmen (1.1.3)
+ activesupport (>= 3.0.0)
+ concurrent-ruby (1.1.5)
+ crass (1.0.5)
+ erubi (1.9.0)
+ globalid (0.4.2)
+ activesupport (>= 4.2.0)
+ i18n (1.7.0)
+ concurrent-ruby (~> 1.0)
+ loofah (2.3.1)
+ crass (~> 1.0.2)
+ nokogiri (>= 1.5.9)
+ mail (2.7.1)
+ mini_mime (>= 0.1.1)
+ method_source (0.9.2)
+ mini_mime (1.0.2)
+ mini_portile2 (2.4.0)
+ minitest (5.13.0)
+ nio4r (2.5.2)
+ nokogiri (1.10.4)
+ mini_portile2 (~> 2.4.0)
+ power_assert (1.1.5)
+ rack (2.0.7)
+ rack-test (1.1.0)
+ rack (>= 1.0, < 3)
+ rails (5.1.7)
+ actioncable (= 5.1.7)
+ actionmailer (= 5.1.7)
+ actionpack (= 5.1.7)
+ actionview (= 5.1.7)
+ activejob (= 5.1.7)
+ activemodel (= 5.1.7)
+ activerecord (= 5.1.7)
+ activesupport (= 5.1.7)
+ bundler (>= 1.3.0)
+ railties (= 5.1.7)
+ sprockets-rails (>= 2.0.0)
+ rails-dom-testing (2.0.3)
+ activesupport (>= 4.2.0)
+ nokogiri (>= 1.6)
+ rails-html-sanitizer (1.3.0)
+ loofah (~> 2.3)
+ railties (5.1.7)
+ actionpack (= 5.1.7)
+ activesupport (= 5.1.7)
+ method_source
+ rake (>= 0.8.7)
+ thor (>= 0.18.1, < 2.0)
+ rake (13.0.0)
+ sprockets (3.7.2)
+ concurrent-ruby (~> 1.0)
+ rack (> 1, < 3)
+ sprockets-rails (3.2.1)
+ actionpack (>= 4.0)
+ activesupport (>= 4.0)
+ sprockets (>= 3.0.0)
+ test-unit (3.3.4)
+ power_assert
+ thor (0.20.3)
+ thread_safe (0.3.6)
+ tzinfo (1.2.5)
+ thread_safe (~> 0.1)
+ websocket-driver (0.6.5)
+ websocket-extensions (>= 0.1.0)
+ websocket-extensions (0.1.4)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ appraisal (= 2.2.0)
+ carmen-rails!
+ minitest
+ rails (~> 5.1.0)
+ sprockets (~> 3.7)
+ test-unit (~> 3.0)
+
+BUNDLED WITH
+ 1.17.2
diff --git a/gemfiles/rails_5.2.gemfile b/gemfiles/rails_5.2.gemfile
new file mode 100644
index 0000000..7a73c8a
--- /dev/null
+++ b/gemfiles/rails_5.2.gemfile
@@ -0,0 +1,10 @@
+# This file was generated by Appraisal
+
+source "http://rubygems.org"
+
+gem "appraisal", "2.2.0"
+gem "rails", "~> 5.2.0"
+gem "test-unit", "~> 3.0"
+gem "sprockets", "~> 3.7"
+
+gemspec path: "../"
diff --git a/gemfiles/rails_5.2.gemfile.lock b/gemfiles/rails_5.2.gemfile.lock
new file mode 100644
index 0000000..f91a202
--- /dev/null
+++ b/gemfiles/rails_5.2.gemfile.lock
@@ -0,0 +1,140 @@
+PATH
+ remote: ..
+ specs:
+ carmen-rails (1.0.1)
+ carmen (~> 1.0)
+ rails
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actioncable (5.2.3)
+ actionpack (= 5.2.3)
+ nio4r (~> 2.0)
+ websocket-driver (>= 0.6.1)
+ actionmailer (5.2.3)
+ actionpack (= 5.2.3)
+ actionview (= 5.2.3)
+ activejob (= 5.2.3)
+ mail (~> 2.5, >= 2.5.4)
+ rails-dom-testing (~> 2.0)
+ actionpack (5.2.3)
+ actionview (= 5.2.3)
+ activesupport (= 5.2.3)
+ rack (~> 2.0)
+ rack-test (>= 0.6.3)
+ rails-dom-testing (~> 2.0)
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
+ actionview (5.2.3)
+ activesupport (= 5.2.3)
+ builder (~> 3.1)
+ erubi (~> 1.4)
+ rails-dom-testing (~> 2.0)
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
+ activejob (5.2.3)
+ activesupport (= 5.2.3)
+ globalid (>= 0.3.6)
+ activemodel (5.2.3)
+ activesupport (= 5.2.3)
+ activerecord (5.2.3)
+ activemodel (= 5.2.3)
+ activesupport (= 5.2.3)
+ arel (>= 9.0)
+ activestorage (5.2.3)
+ actionpack (= 5.2.3)
+ activerecord (= 5.2.3)
+ marcel (~> 0.3.1)
+ activesupport (5.2.3)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
+ i18n (>= 0.7, < 2)
+ minitest (~> 5.1)
+ tzinfo (~> 1.1)
+ appraisal (2.2.0)
+ bundler
+ rake
+ thor (>= 0.14.0)
+ arel (9.0.0)
+ builder (3.2.3)
+ carmen (1.1.3)
+ activesupport (>= 3.0.0)
+ concurrent-ruby (1.1.5)
+ crass (1.0.5)
+ erubi (1.9.0)
+ globalid (0.4.2)
+ activesupport (>= 4.2.0)
+ i18n (1.7.0)
+ concurrent-ruby (~> 1.0)
+ loofah (2.3.1)
+ crass (~> 1.0.2)
+ nokogiri (>= 1.5.9)
+ mail (2.7.1)
+ mini_mime (>= 0.1.1)
+ marcel (0.3.3)
+ mimemagic (~> 0.3.2)
+ method_source (0.9.2)
+ mimemagic (0.3.3)
+ mini_mime (1.0.2)
+ mini_portile2 (2.4.0)
+ minitest (5.13.0)
+ nio4r (2.5.2)
+ nokogiri (1.10.4)
+ mini_portile2 (~> 2.4.0)
+ power_assert (1.1.5)
+ rack (2.0.7)
+ rack-test (1.1.0)
+ rack (>= 1.0, < 3)
+ rails (5.2.3)
+ actioncable (= 5.2.3)
+ actionmailer (= 5.2.3)
+ actionpack (= 5.2.3)
+ actionview (= 5.2.3)
+ activejob (= 5.2.3)
+ activemodel (= 5.2.3)
+ activerecord (= 5.2.3)
+ activestorage (= 5.2.3)
+ activesupport (= 5.2.3)
+ bundler (>= 1.3.0)
+ railties (= 5.2.3)
+ sprockets-rails (>= 2.0.0)
+ rails-dom-testing (2.0.3)
+ activesupport (>= 4.2.0)
+ nokogiri (>= 1.6)
+ rails-html-sanitizer (1.3.0)
+ loofah (~> 2.3)
+ railties (5.2.3)
+ actionpack (= 5.2.3)
+ activesupport (= 5.2.3)
+ method_source
+ rake (>= 0.8.7)
+ thor (>= 0.19.0, < 2.0)
+ rake (13.0.0)
+ sprockets (3.7.2)
+ concurrent-ruby (~> 1.0)
+ rack (> 1, < 3)
+ sprockets-rails (3.2.1)
+ actionpack (>= 4.0)
+ activesupport (>= 4.0)
+ sprockets (>= 3.0.0)
+ test-unit (3.3.4)
+ power_assert
+ thor (0.20.3)
+ thread_safe (0.3.6)
+ tzinfo (1.2.5)
+ thread_safe (~> 0.1)
+ websocket-driver (0.7.1)
+ websocket-extensions (>= 0.1.0)
+ websocket-extensions (0.1.4)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ appraisal (= 2.2.0)
+ carmen-rails!
+ minitest
+ rails (~> 5.2.0)
+ sprockets (~> 3.7)
+ test-unit (~> 3.0)
+
+BUNDLED WITH
+ 1.17.2
diff --git a/gemfiles/rails_6.0.gemfile b/gemfiles/rails_6.0.gemfile
new file mode 100644
index 0000000..4fbbcd9
--- /dev/null
+++ b/gemfiles/rails_6.0.gemfile
@@ -0,0 +1,10 @@
+# This file was generated by Appraisal
+
+source "http://rubygems.org"
+
+gem "appraisal", "2.2.0"
+gem "rails", "~> 6.0.0"
+gem "test-unit", "~> 3.0"
+gem "sprockets", "~> 4.0"
+
+gemspec path: "../"
diff --git a/gemfiles/rails_6.0.gemfile.lock b/gemfiles/rails_6.0.gemfile.lock
new file mode 100644
index 0000000..0533afd
--- /dev/null
+++ b/gemfiles/rails_6.0.gemfile.lock
@@ -0,0 +1,156 @@
+PATH
+ remote: ..
+ specs:
+ carmen-rails (1.0.1)
+ carmen (~> 1.0)
+ rails
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actioncable (6.0.0)
+ actionpack (= 6.0.0)
+ nio4r (~> 2.0)
+ websocket-driver (>= 0.6.1)
+ actionmailbox (6.0.0)
+ actionpack (= 6.0.0)
+ activejob (= 6.0.0)
+ activerecord (= 6.0.0)
+ activestorage (= 6.0.0)
+ activesupport (= 6.0.0)
+ mail (>= 2.7.1)
+ actionmailer (6.0.0)
+ actionpack (= 6.0.0)
+ actionview (= 6.0.0)
+ activejob (= 6.0.0)
+ mail (~> 2.5, >= 2.5.4)
+ rails-dom-testing (~> 2.0)
+ actionpack (6.0.0)
+ actionview (= 6.0.0)
+ activesupport (= 6.0.0)
+ rack (~> 2.0)
+ rack-test (>= 0.6.3)
+ rails-dom-testing (~> 2.0)
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
+ actiontext (6.0.0)
+ actionpack (= 6.0.0)
+ activerecord (= 6.0.0)
+ activestorage (= 6.0.0)
+ activesupport (= 6.0.0)
+ nokogiri (>= 1.8.5)
+ actionview (6.0.0)
+ activesupport (= 6.0.0)
+ builder (~> 3.1)
+ erubi (~> 1.4)
+ rails-dom-testing (~> 2.0)
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
+ activejob (6.0.0)
+ activesupport (= 6.0.0)
+ globalid (>= 0.3.6)
+ activemodel (6.0.0)
+ activesupport (= 6.0.0)
+ activerecord (6.0.0)
+ activemodel (= 6.0.0)
+ activesupport (= 6.0.0)
+ activestorage (6.0.0)
+ actionpack (= 6.0.0)
+ activejob (= 6.0.0)
+ activerecord (= 6.0.0)
+ marcel (~> 0.3.1)
+ activesupport (6.0.0)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
+ i18n (>= 0.7, < 2)
+ minitest (~> 5.1)
+ tzinfo (~> 1.1)
+ zeitwerk (~> 2.1, >= 2.1.8)
+ appraisal (2.2.0)
+ bundler
+ rake
+ thor (>= 0.14.0)
+ builder (3.2.3)
+ carmen (1.1.3)
+ activesupport (>= 3.0.0)
+ concurrent-ruby (1.1.5)
+ crass (1.0.5)
+ erubi (1.9.0)
+ globalid (0.4.2)
+ activesupport (>= 4.2.0)
+ i18n (1.7.0)
+ concurrent-ruby (~> 1.0)
+ loofah (2.3.1)
+ crass (~> 1.0.2)
+ nokogiri (>= 1.5.9)
+ mail (2.7.1)
+ mini_mime (>= 0.1.1)
+ marcel (0.3.3)
+ mimemagic (~> 0.3.2)
+ method_source (0.9.2)
+ mimemagic (0.3.3)
+ mini_mime (1.0.2)
+ mini_portile2 (2.4.0)
+ minitest (5.13.0)
+ nio4r (2.5.2)
+ nokogiri (1.10.4)
+ mini_portile2 (~> 2.4.0)
+ power_assert (1.1.5)
+ rack (2.0.7)
+ rack-test (1.1.0)
+ rack (>= 1.0, < 3)
+ rails (6.0.0)
+ actioncable (= 6.0.0)
+ actionmailbox (= 6.0.0)
+ actionmailer (= 6.0.0)
+ actionpack (= 6.0.0)
+ actiontext (= 6.0.0)
+ actionview (= 6.0.0)
+ activejob (= 6.0.0)
+ activemodel (= 6.0.0)
+ activerecord (= 6.0.0)
+ activestorage (= 6.0.0)
+ activesupport (= 6.0.0)
+ bundler (>= 1.3.0)
+ railties (= 6.0.0)
+ sprockets-rails (>= 2.0.0)
+ rails-dom-testing (2.0.3)
+ activesupport (>= 4.2.0)
+ nokogiri (>= 1.6)
+ rails-html-sanitizer (1.3.0)
+ loofah (~> 2.3)
+ railties (6.0.0)
+ actionpack (= 6.0.0)
+ activesupport (= 6.0.0)
+ method_source
+ rake (>= 0.8.7)
+ thor (>= 0.20.3, < 2.0)
+ rake (13.0.0)
+ sprockets (4.0.0)
+ concurrent-ruby (~> 1.0)
+ rack (> 1, < 3)
+ sprockets-rails (3.2.1)
+ actionpack (>= 4.0)
+ activesupport (>= 4.0)
+ sprockets (>= 3.0.0)
+ test-unit (3.3.4)
+ power_assert
+ thor (0.20.3)
+ thread_safe (0.3.6)
+ tzinfo (1.2.5)
+ thread_safe (~> 0.1)
+ websocket-driver (0.7.1)
+ websocket-extensions (>= 0.1.0)
+ websocket-extensions (0.1.4)
+ zeitwerk (2.2.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ appraisal (= 2.2.0)
+ carmen-rails!
+ minitest
+ rails (~> 6.0.0)
+ sprockets (~> 4.0)
+ test-unit (~> 3.0)
+
+BUNDLED WITH
+ 1.17.2
diff --git a/lib/carmen/rails/action_view/form_helper.rb b/lib/carmen/rails/action_view/form_helper.rb
index d5f5510..01fd7d4 100644
--- a/lib/carmen/rails/action_view/form_helper.rb
+++ b/lib/carmen/rails/action_view/form_helper.rb
@@ -197,15 +197,20 @@ def to_region_select_tag(parent_region, options = {}, html_options = {})
end
end
- if Rails::VERSION::MAJOR == 4
+ if [4, 5, 6].include? Rails::VERSION::MAJOR
module Tags
class Base
def to_region_select_tag(parent_region, options = {}, html_options = {})
html_options = html_options.stringify_keys
add_default_name_and_id(html_options)
- options[:include_blank] ||= true unless options[:prompt] || select_not_required?(html_options)
- value = options[:selected] ? options[:selected] : value(object)
+ if (Rails::VERSION::MAJOR == 4 && !select_not_required?(html_options)) ||
+ ([5, 6].include?(Rails::VERSION::MAJOR) && placeholder_required?(html_options))
+ raise ArgumentError, "include_blank cannot be false for a required field." if options[:include_blank] == false
+ options[:include_blank] ||= true unless options[:prompt]
+ end
+
+ value = options[:selected] ? options[:selected] : (method(:value).arity.zero? ? value() : value(object))
priority_regions = options[:priority] || []
opts = add_options(region_options_for_select(parent_region.subregions, value,
:priority => priority_regions),
diff --git a/lib/tasks/carmen-rails_tasks.rake b/lib/tasks/carmen-rails_tasks.rake
deleted file mode 100644
index 98a799d..0000000
--- a/lib/tasks/carmen-rails_tasks.rake
+++ /dev/null
@@ -1,4 +0,0 @@
-# desc "Explaining what the task does"
-# task :carmen-rails do
-# # Task goes here
-# end
diff --git a/test/carmen/action_view/helpers/form_helper_test.rb b/test/carmen/action_view/helpers/carmen_view_helper_test.rb
similarity index 93%
rename from test/carmen/action_view/helpers/form_helper_test.rb
rename to test/carmen/action_view/helpers/carmen_view_helper_test.rb
index 5b5fd29..5a5d017 100644
--- a/test/carmen/action_view/helpers/form_helper_test.rb
+++ b/test/carmen/action_view/helpers/carmen_view_helper_test.rb
@@ -1,12 +1,18 @@
require 'test_helper'
-class CarmenViewHelperTest < MiniTest::Unit::TestCase
+class CarmenViewHelperTest < MiniTest::Test
include ActionView::Helpers::FormOptionsHelper
include ActionView::Helpers::FormTagHelper
- include ActionDispatch::Assertions::SelectorAssertions
+
+ if ::Rails.const_defined?(:Dom)
+ include ::Rails::Dom::Testing::Assertions::SelectorAssertions
+ else
+ include ActionDispatch::Assertions::SelectorAssertions
+ end
def setup
@object = OpenStruct.new
+
def @object.to_s; 'object'; end
end
@@ -27,6 +33,10 @@ def test_basic_country_select
assert_equal_markup(expected, html)
end
+ def document_root_element
+ Nokogiri.parse(@html)
+ end
+
def test_country_selected_value
@html = country_select(:object, :country_code, :selected => 'OC')
assert_select('option[selected="selected"][value="OC"]')
@@ -123,6 +133,7 @@ def test_basic_subregion_select
expected = <<-HTML
HTML
@@ -135,6 +146,7 @@ def test_subregion_select_using_parent_code
expected = <<-HTML
HTML
@@ -181,6 +193,7 @@ def test_basic_subregion_select_tag
expected = <<-HTML
HTML
@@ -196,6 +209,7 @@ def test_subregion_select_tag_with_priority
+
HTML
@@ -210,6 +224,7 @@ def test_subregion_select_tag_with_prompt
HTML
@@ -252,7 +267,7 @@ def test_region_options_for_select_with_array_of_regions_and_priority
end
def test_form_builder_country_select
- form = ActionView::Helpers::FormBuilder.new(:object, @object, self, {}, lambda{})
+ form = ActionView::Helpers::FormBuilder.new(:object, @object, self, {})
html = form.country_select('attribute_name')
expected = <<-HTML
@@ -268,14 +283,14 @@ def test_form_builder_country_select
def test_form_builder_selected_country
@object.country_code = 'OC'
- form = ActionView::Helpers::FormBuilder.new(:object, @object, self, {}, lambda{})
+ form = ActionView::Helpers::FormBuilder.new(:object, @object, self, {})
@html = form.country_select('country_code')
assert_select('option[selected="selected"][value="OC"]')
end
def test_form_builder_country_select_deprecated_api
- form = ActionView::Helpers::FormBuilder.new(:object, @object, self, {}, lambda{})
+ form = ActionView::Helpers::FormBuilder.new(:object, @object, self, {})
html = form.country_select('attribute_name', ['ES'])
expected = <<-HTML
@@ -292,11 +307,12 @@ def test_form_builder_country_select_deprecated_api
end
def test_form_builder_subregion_select
- form = ActionView::Helpers::FormBuilder.new(:object, @object, self, {}, lambda{})
+ form = ActionView::Helpers::FormBuilder.new(:object, @object, self, {})
html = form.subregion_select(:subregion_code, 'OC')
expected = <<-HTML
HTML
@@ -305,7 +321,7 @@ def test_form_builder_subregion_select
def test_form_builder_selected_subregion
@object.subregion_code = 'AO'
- form = ActionView::Helpers::FormBuilder.new(:object, @object, self, {}, lambda{})
+ form = ActionView::Helpers::FormBuilder.new(:object, @object, self, {})
@html = form.subregion_select(:subregion_code, 'OC')
assert_select('option[selected="selected"][value="AO"]')
diff --git a/test/spec_data/data/world.yml b/test/spec_data/data/world.yml
new file mode 100644
index 0000000..99d6382
--- /dev/null
+++ b/test/spec_data/data/world.yml
@@ -0,0 +1,13 @@
+---
+- alpha_2_code: OC
+ alpha_3_code: OCE
+ numeric_code: "001"
+ type: country
+- alpha_2_code: EU
+ alpha_3_code: EUR
+ numeric_code: "002"
+ type: country
+- alpha_2_code: ES
+ alpha_3_code: EST
+ numeric_code: "003"
+ type: country
diff --git a/test/spec_data/data/world/oc.yml b/test/spec_data/data/world/oc.yml
new file mode 100644
index 0000000..a4d2144
--- /dev/null
+++ b/test/spec_data/data/world/oc.yml
@@ -0,0 +1,5 @@
+---
+- code: AO
+ type: province
+- code: AT
+ type: province
diff --git a/test/spec_data/data/world/oc/ao.yml b/test/spec_data/data/world/oc/ao.yml
new file mode 100644
index 0000000..1945668
--- /dev/null
+++ b/test/spec_data/data/world/oc/ao.yml
@@ -0,0 +1,3 @@
+---
+- code: LO
+ type: city
diff --git a/test/spec_data/locale/de/world.yml b/test/spec_data/locale/de/world.yml
new file mode 100644
index 0000000..a8fdf1f
--- /dev/null
+++ b/test/spec_data/locale/de/world.yml
@@ -0,0 +1,7 @@
+---
+de:
+ world:
+ eu:
+ common_name: Eurasia
+ name: Das großartige Staat von Eurasia
+ official_name: Das großartige Staat von Eurasia
diff --git a/test/spec_data/locale/en/world.yml b/test/spec_data/locale/en/world.yml
new file mode 100644
index 0000000..b47e88c
--- /dev/null
+++ b/test/spec_data/locale/en/world.yml
@@ -0,0 +1,15 @@
+---
+en:
+ world:
+ oc:
+ common_name: Oceania
+ name: Oceania
+ official_name: The Superstate of Oceania
+ eu:
+ common_name: Eurasia
+ name: Eurasia
+ official_name: The Superstate of Eurasia
+ es:
+ common_name: Eastasia
+ name: Eastasia
+ official_name: The Superstate of Eastasia
diff --git a/test/spec_data/locale/en/world/oc.yml b/test/spec_data/locale/en/world/oc.yml
new file mode 100644
index 0000000..b007c6c
--- /dev/null
+++ b/test/spec_data/locale/en/world/oc.yml
@@ -0,0 +1,8 @@
+---
+en:
+ world:
+ oc:
+ ao:
+ name: Airstrip One
+ at:
+ name: Airstrip-Two
diff --git a/test/spec_data/locale/en/world/oc/ao.yml b/test/spec_data/locale/en/world/oc/ao.yml
new file mode 100644
index 0000000..38b8951
--- /dev/null
+++ b/test/spec_data/locale/en/world/oc/ao.yml
@@ -0,0 +1,7 @@
+---
+en:
+ world:
+ oc:
+ ao:
+ lo:
+ name: London
diff --git a/test/spec_data/overlay/data/world.yml b/test/spec_data/overlay/data/world.yml
new file mode 100644
index 0000000..2756cf4
--- /dev/null
+++ b/test/spec_data/overlay/data/world.yml
@@ -0,0 +1,12 @@
+---
+- alpha_2_code: SE
+ alpha_3_code: SEA
+ numeric_code: "004"
+ common_name: Sealand
+ name: Sealand
+ official_name: The Principality of Sealand
+ type: fort
+- alpha_2_code: EU
+ _enabled: false
+- alpha_2_code: ES
+ official_name: The Wonderous Country of Eastasia
diff --git a/test/spec_data/overlay/locale/de/world.yml b/test/spec_data/overlay/locale/de/world.yml
new file mode 100644
index 0000000..d5fd86b
--- /dev/null
+++ b/test/spec_data/overlay/locale/de/world.yml
@@ -0,0 +1,3 @@
+---
+de:
+ world:
diff --git a/test/spec_data/overlay/locale/en/world.yml b/test/spec_data/overlay/locale/en/world.yml
new file mode 100644
index 0000000..1dd67be
--- /dev/null
+++ b/test/spec_data/overlay/locale/en/world.yml
@@ -0,0 +1,10 @@
+---
+en:
+ world:
+ es:
+ official_name: The Wonderous Country of Eastasia
+ se:
+ common_name: Sealand
+ name: Sealand
+ official_name: The Principality of Sealand
+
diff --git a/test/spec_data/overlay/locale/en/world/oc.yml b/test/spec_data/overlay/locale/en/world/oc.yml
new file mode 100644
index 0000000..a8ceb29
--- /dev/null
+++ b/test/spec_data/overlay/locale/en/world/oc.yml
@@ -0,0 +1,6 @@
+---
+en:
+ world:
+ oc:
+ ao:
+ name: Airstrip Uno
diff --git a/test/spec_data/overlay/locale/zz/world.yml b/test/spec_data/overlay/locale/zz/world.yml
new file mode 100644
index 0000000..0e92eef
--- /dev/null
+++ b/test/spec_data/overlay/locale/zz/world.yml
@@ -0,0 +1,5 @@
+---
+zz:
+ world:
+ es:
+ official_name: The Zonderous Zountry of Zeastasia
diff --git a/test/spec_data/overlay/locale/zz/world/oc.yml b/test/spec_data/overlay/locale/zz/world/oc.yml
new file mode 100644
index 0000000..aaf3b46
--- /dev/null
+++ b/test/spec_data/overlay/locale/zz/world/oc.yml
@@ -0,0 +1,6 @@
+---
+zz:
+ world:
+ oc:
+ ao:
+ name: Zairstrip Zuno
diff --git a/test/test_helper.rb b/test/test_helper.rb
index bd63c69..ffdcca6 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -9,20 +9,19 @@
require 'rails'
require 'carmen-rails'
require 'ostruct'
-require 'debugger'
MiniTest::Spec.register_spec_type(/.*/, ActionView::TestCase)
Carmen.clear_data_paths
-carmen_path = File.expand_path('../../../carmen', __FILE__)
+carmen_path = File.expand_path('..', __FILE__)
Carmen.append_data_path(carmen_path + '/spec_data/data')
locale_path = carmen_path + '/spec_data/locale'
Carmen.i18n_backend = Carmen::I18n::Simple.new(locale_path)
-class MiniTest::Unit::TestCase
+class MiniTest::Test
def assert_equal_markup(expected, actual, message=nil)
assert_equal(clean_markup(expected), clean_markup(actual), message)
end