Browse Source

Merge pull request #4 from saberma/saberma-enhancement/support-rails3.1-3.2

支持 rails3.1, 3.2 版本
Saber 10 years ago
parent
commit
a266610c65

+ 19 - 4
.travis.yml

@@ -1,7 +1,22 @@
 language: ruby
 
-rvm:
-  - 2.0.0
+bundler_args: '' # avoid travis-ci to set deployment mode by default
 
-script:
-  - bundle exec rspec spec
+before_script: bundle install
+
+script: bundle exec rake spec
+
+rvm: 2.0.0
+
+gemfile:
+  - gemfiles/rails4.gemfile
+  - gemfiles/rails32.gemfile
+  - gemfiles/rails31.gemfile
+
+matrix:
+  exclude:
+    - rvm: 2.0.0
+      gemfile: gemfiles/rails31.gemfile
+  include:
+    - rvm: 1.9.3
+      gemfile: gemfiles/rails31.gemfile

+ 11 - 0
Appraisals

@@ -0,0 +1,11 @@
+appraise "rails31" do
+  gem "rails", "~> 3.1.0"
+end
+
+appraise "rails32" do
+  gem "rails", "~> 3.2.0"
+end
+
+appraise "rails4" do
+  gem "rails", "~> 4.0.0"
+end

+ 2 - 0
Gemfile

@@ -1,3 +1,4 @@
+# rails plugin new china_city --dummy-path=spec/dummy --skip-test-unit --mountable
 if ENV['TRAVIS']
   source 'https://rubygems.org'
 else
@@ -15,5 +16,6 @@ gemspec
 # your gem to rubygems.org.
 
 gem 'jquery-rails' # fixed: ActionView::Template::Error: couldn't find file 'jquery'
+gem 'appraisal'
 # To use debugger
 # gem 'debugger'

+ 80 - 71
Gemfile.lock

@@ -2,103 +2,117 @@ PATH
   remote: .
   specs:
     china_city (0.0.2)
-      jquery-rails (~> 3.0.4)
-      rails (~> 4.0.0)
+      jquery-rails
+      rails (>= 3.1.0)
 
 GEM
   remote: http://ruby.taobao.org/
   specs:
-    actionmailer (4.0.0)
-      actionpack (= 4.0.0)
-      mail (~> 2.5.3)
-    actionpack (4.0.0)
-      activesupport (= 4.0.0)
-      builder (~> 3.1.0)
+    actionmailer (3.1.12)
+      actionpack (= 3.1.12)
+      mail (~> 2.4.4)
+    actionpack (3.1.12)
+      activemodel (= 3.1.12)
+      activesupport (= 3.1.12)
+      builder (~> 3.0.0)
       erubis (~> 2.7.0)
-      rack (~> 1.5.2)
-      rack-test (~> 0.6.2)
-    activemodel (4.0.0)
-      activesupport (= 4.0.0)
-      builder (~> 3.1.0)
-    activerecord (4.0.0)
-      activemodel (= 4.0.0)
-      activerecord-deprecated_finders (~> 1.0.2)
-      activesupport (= 4.0.0)
-      arel (~> 4.0.0)
-    activerecord-deprecated_finders (1.0.3)
-    activesupport (4.0.0)
-      i18n (~> 0.6, >= 0.6.4)
-      minitest (~> 4.2)
-      multi_json (~> 1.3)
-      thread_safe (~> 0.1)
-      tzinfo (~> 0.3.37)
+      i18n (~> 0.6)
+      rack (~> 1.3.6)
+      rack-cache (~> 1.2)
+      rack-mount (~> 0.8.2)
+      rack-test (~> 0.6.1)
+      sprockets (~> 2.0.4)
+    activemodel (3.1.12)
+      activesupport (= 3.1.12)
+      builder (~> 3.0.0)
+      i18n (~> 0.6)
+    activerecord (3.1.12)
+      activemodel (= 3.1.12)
+      activesupport (= 3.1.12)
+      arel (~> 2.2.3)
+      tzinfo (~> 0.3.29)
+    activeresource (3.1.12)
+      activemodel (= 3.1.12)
+      activesupport (= 3.1.12)
+    activesupport (3.1.12)
+      multi_json (~> 1.0)
     addressable (2.3.5)
-    arel (4.0.0)
-    atomic (1.1.12)
-    builder (3.1.4)
+    appraisal (0.5.2)
+      bundler
+      rake
+    arel (2.2.3)
+    builder (3.0.4)
     capybara (2.1.0)
       mime-types (>= 1.16)
       nokogiri (>= 1.3.3)
       rack (>= 1.0.0)
       rack-test (>= 0.5.4)
       xpath (~> 2.0)
-    coffee-rails (4.0.0)
+    cliver (0.2.1)
+    coffee-rails (3.1.1)
       coffee-script (>= 2.2.0)
-      railties (>= 4.0.0.beta, < 5.0)
+      railties (~> 3.1.0)
     coffee-script (2.2.0)
       coffee-script-source
       execjs
     coffee-script-source (1.6.3)
     diff-lcs (1.2.4)
     erubis (2.7.0)
-    eventmachine (1.0.3)
-    execjs (1.4.0)
-      multi_json (~> 1.0)
-    faye-websocket (0.4.7)
-      eventmachine (>= 0.12.0)
+    execjs (2.0.1)
     hike (1.2.3)
-    http_parser.rb (0.5.3)
-    i18n (0.6.4)
+    i18n (0.6.5)
     jquery-rails (3.0.4)
       railties (>= 3.0, < 5.0)
       thor (>= 0.14, < 2.0)
+    json (1.8.0)
     launchy (2.3.0)
       addressable (~> 2.3)
-    mail (2.5.4)
+    mail (2.4.4)
+      i18n (>= 0.4.0)
       mime-types (~> 1.16)
       treetop (~> 1.4.8)
-    mime-types (1.23)
+    mime-types (1.25)
     mini_portile (0.5.1)
-    minitest (4.7.5)
     multi_json (1.7.9)
     nokogiri (1.6.0)
       mini_portile (~> 0.5.0)
-    poltergeist (1.3.0)
+    poltergeist (1.4.0)
       capybara (~> 2.1.0)
-      faye-websocket (>= 0.4.4, < 0.5.0)
-      http_parser.rb (~> 0.5.3)
+      cliver (~> 0.2.1)
+      multi_json (~> 1.0)
+      websocket-driver (>= 0.2.0)
     polyglot (0.3.3)
-    rack (1.5.2)
+    rack (1.3.10)
+    rack-cache (1.2)
+      rack (>= 0.4)
+    rack-mount (0.8.3)
+      rack (>= 1.0.0)
+    rack-ssl (1.3.3)
+      rack
     rack-test (0.6.2)
       rack (>= 1.0)
-    rails (4.0.0)
-      actionmailer (= 4.0.0)
-      actionpack (= 4.0.0)
-      activerecord (= 4.0.0)
-      activesupport (= 4.0.0)
-      bundler (>= 1.3.0, < 2.0)
-      railties (= 4.0.0)
-      sprockets-rails (~> 2.0.0)
-    railties (4.0.0)
-      actionpack (= 4.0.0)
-      activesupport (= 4.0.0)
+    rails (3.1.12)
+      actionmailer (= 3.1.12)
+      actionpack (= 3.1.12)
+      activerecord (= 3.1.12)
+      activeresource (= 3.1.12)
+      activesupport (= 3.1.12)
+      bundler (~> 1.0)
+      railties (= 3.1.12)
+    railties (3.1.12)
+      actionpack (= 3.1.12)
+      activesupport (= 3.1.12)
+      rack-ssl (~> 1.3.2)
       rake (>= 0.8.7)
-      thor (>= 0.18.1, < 2.0)
+      rdoc (~> 3.4)
+      thor (~> 0.14.6)
     rake (10.1.0)
-    rspec-core (2.14.4)
-    rspec-expectations (2.14.0)
+    rdoc (3.12.2)
+      json (~> 1.4)
+    rspec-core (2.14.5)
+    rspec-expectations (2.14.2)
       diff-lcs (>= 1.1.3, < 2.0)
-    rspec-mocks (2.14.2)
+    rspec-mocks (2.14.3)
     rspec-rails (2.14.0)
       actionpack (>= 3.0)
       activesupport (>= 3.0)
@@ -106,24 +120,18 @@ GEM
       rspec-core (~> 2.14.0)
       rspec-expectations (~> 2.14.0)
       rspec-mocks (~> 2.14.0)
-    sprockets (2.10.0)
+    sprockets (2.0.4)
       hike (~> 1.2)
-      multi_json (~> 1.0)
       rack (~> 1.0)
       tilt (~> 1.1, != 1.3.0)
-    sprockets-rails (2.0.0)
-      actionpack (>= 3.0)
-      activesupport (>= 3.0)
-      sprockets (~> 2.8)
-    sqlite3 (1.3.7)
-    thor (0.18.1)
-    thread_safe (0.1.2)
-      atomic
+    sqlite3 (1.3.8)
+    thor (0.14.6)
     tilt (1.4.1)
-    treetop (1.4.14)
+    treetop (1.4.15)
       polyglot
       polyglot (>= 0.3.1)
     tzinfo (0.3.37)
+    websocket-driver (0.2.3)
     xpath (2.0.0)
       nokogiri (~> 1.3)
 
@@ -131,9 +139,10 @@ PLATFORMS
   ruby
 
 DEPENDENCIES
+  appraisal
   capybara
   china_city!
-  coffee-rails (~> 4.0.0)
+  coffee-rails
   jquery-rails
   launchy
   poltergeist

+ 17 - 1
README.md

@@ -4,6 +4,10 @@
 
 ![china_city](http://cl.ly/image/3c212i1e3b1T/ScreenFlow.mp4.gif)
 
+支持 Rails3.1, Rails3.2, Rails4.0。
+
+请留意,Rails3.1 与 Ruby2.0 不兼容,sprockets 无法正常解析 application.js,请使用 Ruby1.9。
+
 ## 简介
 
 这是一个基于 Rails Engine 开发的插件,为 Rails 项目增加省市区三级(或者省市 二级)选择框,可用于实现收货地址等信息的录入。
@@ -47,10 +51,22 @@
 ```bash
 git clone git@github.com:saberma/china_city.git
 cd china_city
-cd test/dummy
+rake appraisal:install
+cd spec/dummy
 rails server # http://localhost:3000/china_city
 ```
 
+## 测试
+
+```bash
+rvm use 2.0.0
+rake appraisal:rails4 spec
+rake appraisal:rails32 spec
+rvm use 1.9.3
+bundle install
+rake appraisal:rails31 spec
+```
+
 ## 类似项目
 
 * https://github.com/Kehao/area_cn_select

+ 1 - 0
Rakefile

@@ -5,6 +5,7 @@ rescue LoadError
 end
 
 require 'rdoc/task'
+require 'appraisal'
 
 RDoc::Task.new(:rdoc) do |rdoc|
   rdoc.rdoc_dir = 'rdoc'

+ 2 - 1
app/assets/javascripts/china_city/application.js.coffee

@@ -1,2 +1,3 @@
-#= require 'jquery'
+#= require jquery
+#= require china_city/jquery.china_city
 #= require_tree .

+ 5 - 4
china_city.gemspec

@@ -17,13 +17,14 @@ Gem::Specification.new do |s|
   s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
   s.test_files = Dir["spec/**/*"]
 
-  s.add_dependency "rails", "~> 4.0.0"
-  s.add_dependency "jquery-rails", "~> 3.0.4"
+  # s.add_dependency "rails", "~> 3.1.0"
+  s.add_dependency "rails", ">= 3.1.0"
+  s.add_dependency "jquery-rails"
 
   s.add_development_dependency "sqlite3"
   s.add_development_dependency "rspec-rails"
-  s.add_development_dependency "coffee-rails",   "~> 4.0.0"
-  s.add_development_dependency "jquery-rails", "~> 3.0.4"
+  s.add_development_dependency "coffee-rails"
+  s.add_development_dependency "jquery-rails"
   s.add_development_dependency 'capybara'
   s.add_development_dependency 'launchy'
   s.add_development_dependency 'poltergeist'

+ 9 - 0
gemfiles/rails31.gemfile

@@ -0,0 +1,9 @@
+# This file was generated by Appraisal
+
+source "http://ruby.taobao.org"
+
+gem "jquery-rails"
+gem "appraisal"
+gem "rails", "~> 3.1.0"
+
+gemspec :path=>"../"

+ 151 - 0
gemfiles/rails31.gemfile.lock

@@ -0,0 +1,151 @@
+PATH
+  remote: /Users/saberma/Documents/china_city
+  specs:
+    china_city (0.0.2)
+      jquery-rails
+      rails (>= 3.1.0)
+
+GEM
+  remote: http://ruby.taobao.org/
+  specs:
+    actionmailer (3.1.12)
+      actionpack (= 3.1.12)
+      mail (~> 2.4.4)
+    actionpack (3.1.12)
+      activemodel (= 3.1.12)
+      activesupport (= 3.1.12)
+      builder (~> 3.0.0)
+      erubis (~> 2.7.0)
+      i18n (~> 0.6)
+      rack (~> 1.3.6)
+      rack-cache (~> 1.2)
+      rack-mount (~> 0.8.2)
+      rack-test (~> 0.6.1)
+      sprockets (~> 2.0.4)
+    activemodel (3.1.12)
+      activesupport (= 3.1.12)
+      builder (~> 3.0.0)
+      i18n (~> 0.6)
+    activerecord (3.1.12)
+      activemodel (= 3.1.12)
+      activesupport (= 3.1.12)
+      arel (~> 2.2.3)
+      tzinfo (~> 0.3.29)
+    activeresource (3.1.12)
+      activemodel (= 3.1.12)
+      activesupport (= 3.1.12)
+    activesupport (3.1.12)
+      multi_json (~> 1.0)
+    addressable (2.3.5)
+    appraisal (0.5.2)
+      bundler
+      rake
+    arel (2.2.3)
+    builder (3.0.4)
+    capybara (2.1.0)
+      mime-types (>= 1.16)
+      nokogiri (>= 1.3.3)
+      rack (>= 1.0.0)
+      rack-test (>= 0.5.4)
+      xpath (~> 2.0)
+    cliver (0.2.1)
+    coffee-rails (3.1.1)
+      coffee-script (>= 2.2.0)
+      railties (~> 3.1.0)
+    coffee-script (2.2.0)
+      coffee-script-source
+      execjs
+    coffee-script-source (1.6.3)
+    diff-lcs (1.2.4)
+    erubis (2.7.0)
+    execjs (2.0.1)
+    hike (1.2.3)
+    i18n (0.6.5)
+    jquery-rails (3.0.4)
+      railties (>= 3.0, < 5.0)
+      thor (>= 0.14, < 2.0)
+    json (1.8.0)
+    launchy (2.3.0)
+      addressable (~> 2.3)
+    mail (2.4.4)
+      i18n (>= 0.4.0)
+      mime-types (~> 1.16)
+      treetop (~> 1.4.8)
+    mime-types (1.25)
+    mini_portile (0.5.1)
+    multi_json (1.7.9)
+    nokogiri (1.6.0)
+      mini_portile (~> 0.5.0)
+    poltergeist (1.4.0)
+      capybara (~> 2.1.0)
+      cliver (~> 0.2.1)
+      multi_json (~> 1.0)
+      websocket-driver (>= 0.2.0)
+    polyglot (0.3.3)
+    rack (1.3.10)
+    rack-cache (1.2)
+      rack (>= 0.4)
+    rack-mount (0.8.3)
+      rack (>= 1.0.0)
+    rack-ssl (1.3.3)
+      rack
+    rack-test (0.6.2)
+      rack (>= 1.0)
+    rails (3.1.12)
+      actionmailer (= 3.1.12)
+      actionpack (= 3.1.12)
+      activerecord (= 3.1.12)
+      activeresource (= 3.1.12)
+      activesupport (= 3.1.12)
+      bundler (~> 1.0)
+      railties (= 3.1.12)
+    railties (3.1.12)
+      actionpack (= 3.1.12)
+      activesupport (= 3.1.12)
+      rack-ssl (~> 1.3.2)
+      rake (>= 0.8.7)
+      rdoc (~> 3.4)
+      thor (~> 0.14.6)
+    rake (10.1.0)
+    rdoc (3.12.2)
+      json (~> 1.4)
+    rspec-core (2.14.5)
+    rspec-expectations (2.14.2)
+      diff-lcs (>= 1.1.3, < 2.0)
+    rspec-mocks (2.14.3)
+    rspec-rails (2.14.0)
+      actionpack (>= 3.0)
+      activesupport (>= 3.0)
+      railties (>= 3.0)
+      rspec-core (~> 2.14.0)
+      rspec-expectations (~> 2.14.0)
+      rspec-mocks (~> 2.14.0)
+    sprockets (2.0.4)
+      hike (~> 1.2)
+      rack (~> 1.0)
+      tilt (~> 1.1, != 1.3.0)
+    sqlite3 (1.3.8)
+    thor (0.14.6)
+    tilt (1.4.1)
+    treetop (1.4.15)
+      polyglot
+      polyglot (>= 0.3.1)
+    tzinfo (0.3.37)
+    websocket-driver (0.2.3)
+    xpath (2.0.0)
+      nokogiri (~> 1.3)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  appraisal
+  capybara
+  china_city!
+  coffee-rails
+  jquery-rails
+  launchy
+  poltergeist
+  rails (~> 3.1.0)
+  rspec-rails
+  sqlite3

+ 9 - 0
gemfiles/rails32.gemfile

@@ -0,0 +1,9 @@
+# This file was generated by Appraisal
+
+source "http://ruby.taobao.org"
+
+gem "jquery-rails"
+gem "appraisal"
+gem "rails", "~> 3.2.0"
+
+gemspec :path=>"../"

+ 149 - 0
gemfiles/rails32.gemfile.lock

@@ -0,0 +1,149 @@
+PATH
+  remote: /Users/saberma/Documents/china_city
+  specs:
+    china_city (0.0.2)
+      jquery-rails
+      rails (>= 3.1.0)
+
+GEM
+  remote: http://ruby.taobao.org/
+  specs:
+    actionmailer (3.2.14)
+      actionpack (= 3.2.14)
+      mail (~> 2.5.4)
+    actionpack (3.2.14)
+      activemodel (= 3.2.14)
+      activesupport (= 3.2.14)
+      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.14)
+      activesupport (= 3.2.14)
+      builder (~> 3.0.0)
+    activerecord (3.2.14)
+      activemodel (= 3.2.14)
+      activesupport (= 3.2.14)
+      arel (~> 3.0.2)
+      tzinfo (~> 0.3.29)
+    activeresource (3.2.14)
+      activemodel (= 3.2.14)
+      activesupport (= 3.2.14)
+    activesupport (3.2.14)
+      i18n (~> 0.6, >= 0.6.4)
+      multi_json (~> 1.0)
+    addressable (2.3.5)
+    appraisal (0.5.2)
+      bundler
+      rake
+    arel (3.0.2)
+    builder (3.0.4)
+    capybara (2.1.0)
+      mime-types (>= 1.16)
+      nokogiri (>= 1.3.3)
+      rack (>= 1.0.0)
+      rack-test (>= 0.5.4)
+      xpath (~> 2.0)
+    cliver (0.2.1)
+    coffee-rails (3.2.2)
+      coffee-script (>= 2.2.0)
+      railties (~> 3.2.0)
+    coffee-script (2.2.0)
+      coffee-script-source
+      execjs
+    coffee-script-source (1.6.3)
+    diff-lcs (1.2.4)
+    erubis (2.7.0)
+    execjs (2.0.1)
+    hike (1.2.3)
+    i18n (0.6.5)
+    journey (1.0.4)
+    jquery-rails (3.0.4)
+      railties (>= 3.0, < 5.0)
+      thor (>= 0.14, < 2.0)
+    json (1.8.0)
+    launchy (2.3.0)
+      addressable (~> 2.3)
+    mail (2.5.4)
+      mime-types (~> 1.16)
+      treetop (~> 1.4.8)
+    mime-types (1.25)
+    mini_portile (0.5.1)
+    multi_json (1.7.9)
+    nokogiri (1.6.0)
+      mini_portile (~> 0.5.0)
+    poltergeist (1.4.0)
+      capybara (~> 2.1.0)
+      cliver (~> 0.2.1)
+      multi_json (~> 1.0)
+      websocket-driver (>= 0.2.0)
+    polyglot (0.3.3)
+    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.14)
+      actionmailer (= 3.2.14)
+      actionpack (= 3.2.14)
+      activerecord (= 3.2.14)
+      activeresource (= 3.2.14)
+      activesupport (= 3.2.14)
+      bundler (~> 1.0)
+      railties (= 3.2.14)
+    railties (3.2.14)
+      actionpack (= 3.2.14)
+      activesupport (= 3.2.14)
+      rack-ssl (~> 1.3.2)
+      rake (>= 0.8.7)
+      rdoc (~> 3.4)
+      thor (>= 0.14.6, < 2.0)
+    rake (10.1.0)
+    rdoc (3.12.2)
+      json (~> 1.4)
+    rspec-core (2.14.5)
+    rspec-expectations (2.14.2)
+      diff-lcs (>= 1.1.3, < 2.0)
+    rspec-mocks (2.14.3)
+    rspec-rails (2.14.0)
+      actionpack (>= 3.0)
+      activesupport (>= 3.0)
+      railties (>= 3.0)
+      rspec-core (~> 2.14.0)
+      rspec-expectations (~> 2.14.0)
+      rspec-mocks (~> 2.14.0)
+    sprockets (2.2.2)
+      hike (~> 1.2)
+      multi_json (~> 1.0)
+      rack (~> 1.0)
+      tilt (~> 1.1, != 1.3.0)
+    sqlite3 (1.3.8)
+    thor (0.18.1)
+    tilt (1.4.1)
+    treetop (1.4.15)
+      polyglot
+      polyglot (>= 0.3.1)
+    tzinfo (0.3.37)
+    websocket-driver (0.2.3)
+    xpath (2.0.0)
+      nokogiri (~> 1.3)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  appraisal
+  capybara
+  china_city!
+  coffee-rails
+  jquery-rails
+  launchy
+  poltergeist
+  rails (~> 3.2.0)
+  rspec-rails
+  sqlite3

+ 9 - 0
gemfiles/rails4.gemfile

@@ -0,0 +1,9 @@
+# This file was generated by Appraisal
+
+source "http://ruby.taobao.org"
+
+gem "jquery-rails"
+gem "appraisal"
+gem "rails", "~> 4.0.0"
+
+gemspec :path=>"../"

+ 144 - 0
gemfiles/rails4.gemfile.lock

@@ -0,0 +1,144 @@
+PATH
+  remote: /Users/saberma/Documents/china_city
+  specs:
+    china_city (0.0.2)
+      jquery-rails
+      rails (>= 3.1.0)
+
+GEM
+  remote: http://ruby.taobao.org/
+  specs:
+    actionmailer (4.0.0)
+      actionpack (= 4.0.0)
+      mail (~> 2.5.3)
+    actionpack (4.0.0)
+      activesupport (= 4.0.0)
+      builder (~> 3.1.0)
+      erubis (~> 2.7.0)
+      rack (~> 1.5.2)
+      rack-test (~> 0.6.2)
+    activemodel (4.0.0)
+      activesupport (= 4.0.0)
+      builder (~> 3.1.0)
+    activerecord (4.0.0)
+      activemodel (= 4.0.0)
+      activerecord-deprecated_finders (~> 1.0.2)
+      activesupport (= 4.0.0)
+      arel (~> 4.0.0)
+    activerecord-deprecated_finders (1.0.3)
+    activesupport (4.0.0)
+      i18n (~> 0.6, >= 0.6.4)
+      minitest (~> 4.2)
+      multi_json (~> 1.3)
+      thread_safe (~> 0.1)
+      tzinfo (~> 0.3.37)
+    addressable (2.3.5)
+    appraisal (0.5.2)
+      bundler
+      rake
+    arel (4.0.0)
+    atomic (1.1.12)
+    builder (3.1.4)
+    capybara (2.1.0)
+      mime-types (>= 1.16)
+      nokogiri (>= 1.3.3)
+      rack (>= 1.0.0)
+      rack-test (>= 0.5.4)
+      xpath (~> 2.0)
+    cliver (0.2.1)
+    coffee-rails (4.0.0)
+      coffee-script (>= 2.2.0)
+      railties (>= 4.0.0.beta, < 5.0)
+    coffee-script (2.2.0)
+      coffee-script-source
+      execjs
+    coffee-script-source (1.6.3)
+    diff-lcs (1.2.4)
+    erubis (2.7.0)
+    execjs (2.0.1)
+    hike (1.2.3)
+    i18n (0.6.5)
+    jquery-rails (3.0.4)
+      railties (>= 3.0, < 5.0)
+      thor (>= 0.14, < 2.0)
+    launchy (2.3.0)
+      addressable (~> 2.3)
+    mail (2.5.4)
+      mime-types (~> 1.16)
+      treetop (~> 1.4.8)
+    mime-types (1.25)
+    mini_portile (0.5.1)
+    minitest (4.7.5)
+    multi_json (1.7.9)
+    nokogiri (1.6.0)
+      mini_portile (~> 0.5.0)
+    poltergeist (1.4.0)
+      capybara (~> 2.1.0)
+      cliver (~> 0.2.1)
+      multi_json (~> 1.0)
+      websocket-driver (>= 0.2.0)
+    polyglot (0.3.3)
+    rack (1.5.2)
+    rack-test (0.6.2)
+      rack (>= 1.0)
+    rails (4.0.0)
+      actionmailer (= 4.0.0)
+      actionpack (= 4.0.0)
+      activerecord (= 4.0.0)
+      activesupport (= 4.0.0)
+      bundler (>= 1.3.0, < 2.0)
+      railties (= 4.0.0)
+      sprockets-rails (~> 2.0.0)
+    railties (4.0.0)
+      actionpack (= 4.0.0)
+      activesupport (= 4.0.0)
+      rake (>= 0.8.7)
+      thor (>= 0.18.1, < 2.0)
+    rake (10.1.0)
+    rspec-core (2.14.5)
+    rspec-expectations (2.14.2)
+      diff-lcs (>= 1.1.3, < 2.0)
+    rspec-mocks (2.14.3)
+    rspec-rails (2.14.0)
+      actionpack (>= 3.0)
+      activesupport (>= 3.0)
+      railties (>= 3.0)
+      rspec-core (~> 2.14.0)
+      rspec-expectations (~> 2.14.0)
+      rspec-mocks (~> 2.14.0)
+    sprockets (2.10.0)
+      hike (~> 1.2)
+      multi_json (~> 1.0)
+      rack (~> 1.0)
+      tilt (~> 1.1, != 1.3.0)
+    sprockets-rails (2.0.0)
+      actionpack (>= 3.0)
+      activesupport (>= 3.0)
+      sprockets (~> 2.8)
+    sqlite3 (1.3.8)
+    thor (0.18.1)
+    thread_safe (0.1.2)
+      atomic
+    tilt (1.4.1)
+    treetop (1.4.15)
+      polyglot
+      polyglot (>= 0.3.1)
+    tzinfo (0.3.37)
+    websocket-driver (0.2.3)
+    xpath (2.0.0)
+      nokogiri (~> 1.3)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  appraisal
+  capybara
+  china_city!
+  coffee-rails
+  jquery-rails
+  launchy
+  poltergeist
+  rails (~> 4.0.0)
+  rspec-rails
+  sqlite3

+ 7 - 0
spec/dummy/config/application.rb

@@ -23,6 +23,13 @@ module Dummy
     # 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
+
+    # Rails 3 config
+    # Enable the asset pipeline
+    config.assets.enabled = true
+
+    # Version of your assets, change this if you want to expire all your assets
+    config.assets.version = '1.0'
   end
 end
 

+ 1 - 0
spec/dummy/config/initializers/secret_token.rb

@@ -10,3 +10,4 @@
 # Make sure your secret_key_base is kept private
 # if you're sharing your code publicly.
 Dummy::Application.config.secret_key_base = '9e1c4ade21b6a468450fcd39549c523c01f0c57c9332f1c23175cf2aa7e4afdd805c88fbdc16a16a4db50133a1b676064020c423e6d241d1db8966f093e481f0'
+Dummy::Application.config.secret_token = '968e37b544c846d0dd349dbac41cf973d19b603134e139be97b927d8a97037c94ed0da160635b17212a4024e5e70875dafac710642855fb93e62e1efe5161d85'

+ 6 - 0
spec/dummy/script/rails

@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
+
+APP_PATH = File.expand_path('../../config/application',  __FILE__)
+require File.expand_path('../../config/boot',  __FILE__)
+require 'rails/commands'

+ 1 - 0
spec/features/china_city_spec.rb

@@ -1,3 +1,4 @@
+# encoding: utf-8
 require 'spec_helper'
 
 feature 'china city', js: true do

+ 3 - 0
spec/spec_helper.rb

@@ -10,9 +10,12 @@ require File.expand_path("../dummy/config/environment.rb",  __FILE__)
 require "rspec/rails"
 # require 'capybara/rails'
 require 'capybara/rspec'
+
 require 'capybara/poltergeist'
 Capybara.javascript_driver = :poltergeist
 
+puts "Rails: #{Rails.version}"
+
 RSpec.configure do |config|
   config.treat_symbols_as_metadata_keys_with_true_values = true
   config.run_all_when_everything_filtered = true