diff --git a/Rakefile b/Rakefile index d808f16..37960c8 100644 --- a/Rakefile +++ b/Rakefile @@ -3,9 +3,10 @@ require 'rspec/core/rake_task' Bundler::GemHelper.install_tasks +# Impressionist will use MiniTest instead of RSpec RSpec::Core::RakeTask.new do |task| - task.rspec_opts = "-I ./test_app/spec" - task.pattern = "./test_app/spec/**/*_spec.rb" + task.rspec_opts = "-I ./tests/test_app/spec" + task.pattern = "./tests/test_app/spec/**/*_spec.rb" end task :test => :spec diff --git a/impressionist.gemspec b/impressionist.gemspec index 2b45fc2..85b78d3 100644 --- a/impressionist.gemspec +++ b/impressionist.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |s| s.authors = ['johnmcaliley'] s.files = `git ls-files`.split("\n") - s.test_files = `git ls-files -- {spec,test_app/spec}/*`.split("\n") + s.test_files = `git ls-files -- tests/**/*`.split("\n") s.require_path = 'lib' s.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if s.respond_to? :required_rubygems_version= @@ -26,11 +26,12 @@ Gem::Specification.new do |s| # Capybara has dropped support for Ruby 1.8.7 onwards version 2.0.3 s.add_development_dependency 'capybara', '>= 2.0.3' s.add_development_dependency 'rake', '>= 0.9' - s.add_development_dependency 'rails', '~> 3.1' + s.add_development_dependency 'rails', '>= 3.1' s.add_development_dependency 'rdoc', '>= 2.4.2' s.add_development_dependency 'rspec-rails' s.add_development_dependency 'simplecov' s.add_development_dependency 'sqlite3' s.add_development_dependency 'systemu' - + s.add_development_dependency 'minitest' + s.add_development_dependency 'minitest-rails' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index 92787cc..0000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,5 +0,0 @@ -module Impressionist - def self.mattr_accessor(accessor) - class_variable_set("@@#{accessor}", accessor) - end -end diff --git a/tests/README b/tests/README new file mode 100644 index 0000000..6e3fe68 --- /dev/null +++ b/tests/README @@ -0,0 +1 @@ +Impressionist uses MiniTest diff --git a/test_app/.gitignore b/tests/test_app/.gitignore similarity index 100% rename from test_app/.gitignore rename to tests/test_app/.gitignore diff --git a/test_app/.rspec b/tests/test_app/.rspec similarity index 100% rename from test_app/.rspec rename to tests/test_app/.rspec diff --git a/test_app/Gemfile b/tests/test_app/Gemfile similarity index 100% rename from test_app/Gemfile rename to tests/test_app/Gemfile diff --git a/test_app/README b/tests/test_app/README similarity index 100% rename from test_app/README rename to tests/test_app/README diff --git a/test_app/README.rdoc b/tests/test_app/README.rdoc similarity index 100% rename from test_app/README.rdoc rename to tests/test_app/README.rdoc diff --git a/test_app/Rakefile b/tests/test_app/Rakefile similarity index 100% rename from test_app/Rakefile rename to tests/test_app/Rakefile diff --git a/test_app/app/assets/images/rails.png b/tests/test_app/app/assets/images/rails.png similarity index 100% rename from test_app/app/assets/images/rails.png rename to tests/test_app/app/assets/images/rails.png diff --git a/test_app/app/assets/javascripts/application.js b/tests/test_app/app/assets/javascripts/application.js similarity index 100% rename from test_app/app/assets/javascripts/application.js rename to tests/test_app/app/assets/javascripts/application.js diff --git a/test_app/app/assets/stylesheets/application.css b/tests/test_app/app/assets/stylesheets/application.css similarity index 100% rename from test_app/app/assets/stylesheets/application.css rename to tests/test_app/app/assets/stylesheets/application.css diff --git a/test_app/app/controllers/application_controller.rb b/tests/test_app/app/controllers/application_controller.rb similarity index 100% rename from test_app/app/controllers/application_controller.rb rename to tests/test_app/app/controllers/application_controller.rb diff --git a/test_app/app/controllers/articles_controller.rb b/tests/test_app/app/controllers/articles_controller.rb similarity index 100% rename from test_app/app/controllers/articles_controller.rb rename to tests/test_app/app/controllers/articles_controller.rb diff --git a/test_app/app/controllers/dummy_controller.rb b/tests/test_app/app/controllers/dummy_controller.rb similarity index 100% rename from test_app/app/controllers/dummy_controller.rb rename to tests/test_app/app/controllers/dummy_controller.rb diff --git a/test_app/app/controllers/posts_controller.rb b/tests/test_app/app/controllers/posts_controller.rb similarity index 100% rename from test_app/app/controllers/posts_controller.rb rename to tests/test_app/app/controllers/posts_controller.rb diff --git a/test_app/app/controllers/widgets_controller.rb b/tests/test_app/app/controllers/widgets_controller.rb similarity index 100% rename from test_app/app/controllers/widgets_controller.rb rename to tests/test_app/app/controllers/widgets_controller.rb diff --git a/test_app/app/helpers/application_helper.rb b/tests/test_app/app/helpers/application_helper.rb similarity index 100% rename from test_app/app/helpers/application_helper.rb rename to tests/test_app/app/helpers/application_helper.rb diff --git a/test_app/app/mailers/.gitkeep b/tests/test_app/app/mailers/.gitkeep similarity index 100% rename from test_app/app/mailers/.gitkeep rename to tests/test_app/app/mailers/.gitkeep diff --git a/test_app/app/models/.gitkeep b/tests/test_app/app/models/.gitkeep similarity index 100% rename from test_app/app/models/.gitkeep rename to tests/test_app/app/models/.gitkeep diff --git a/test_app/app/models/article.rb b/tests/test_app/app/models/article.rb similarity index 100% rename from test_app/app/models/article.rb rename to tests/test_app/app/models/article.rb diff --git a/test_app/app/models/dummy.rb b/tests/test_app/app/models/dummy.rb similarity index 100% rename from test_app/app/models/dummy.rb rename to tests/test_app/app/models/dummy.rb diff --git a/test_app/app/models/post.rb b/tests/test_app/app/models/post.rb similarity index 100% rename from test_app/app/models/post.rb rename to tests/test_app/app/models/post.rb diff --git a/test_app/app/models/user.rb b/tests/test_app/app/models/user.rb similarity index 100% rename from test_app/app/models/user.rb rename to tests/test_app/app/models/user.rb diff --git a/test_app/app/models/widget.rb b/tests/test_app/app/models/widget.rb similarity index 100% rename from test_app/app/models/widget.rb rename to tests/test_app/app/models/widget.rb diff --git a/test_app/app/views/articles/index.html.erb b/tests/test_app/app/views/articles/index.html.erb similarity index 100% rename from test_app/app/views/articles/index.html.erb rename to tests/test_app/app/views/articles/index.html.erb diff --git a/test_app/app/views/articles/show.html.erb b/tests/test_app/app/views/articles/show.html.erb similarity index 100% rename from test_app/app/views/articles/show.html.erb rename to tests/test_app/app/views/articles/show.html.erb diff --git a/test_app/app/views/dummy/index.html.erb b/tests/test_app/app/views/dummy/index.html.erb similarity index 100% rename from test_app/app/views/dummy/index.html.erb rename to tests/test_app/app/views/dummy/index.html.erb diff --git a/test_app/app/views/layouts/application.html.erb b/tests/test_app/app/views/layouts/application.html.erb similarity index 100% rename from test_app/app/views/layouts/application.html.erb rename to tests/test_app/app/views/layouts/application.html.erb diff --git a/test_app/app/views/posts/edit.html.erb b/tests/test_app/app/views/posts/edit.html.erb similarity index 100% rename from test_app/app/views/posts/edit.html.erb rename to tests/test_app/app/views/posts/edit.html.erb diff --git a/test_app/app/views/posts/index.html.erb b/tests/test_app/app/views/posts/index.html.erb similarity index 100% rename from test_app/app/views/posts/index.html.erb rename to tests/test_app/app/views/posts/index.html.erb diff --git a/test_app/app/views/posts/show.html.erb b/tests/test_app/app/views/posts/show.html.erb similarity index 100% rename from test_app/app/views/posts/show.html.erb rename to tests/test_app/app/views/posts/show.html.erb diff --git a/test_app/app/views/widgets/index.html.erb b/tests/test_app/app/views/widgets/index.html.erb similarity index 100% rename from test_app/app/views/widgets/index.html.erb rename to tests/test_app/app/views/widgets/index.html.erb diff --git a/test_app/app/views/widgets/new.html.erb b/tests/test_app/app/views/widgets/new.html.erb similarity index 100% rename from test_app/app/views/widgets/new.html.erb rename to tests/test_app/app/views/widgets/new.html.erb diff --git a/test_app/app/views/widgets/show.html.erb b/tests/test_app/app/views/widgets/show.html.erb similarity index 100% rename from test_app/app/views/widgets/show.html.erb rename to tests/test_app/app/views/widgets/show.html.erb diff --git a/test_app/config.ru b/tests/test_app/config.ru similarity index 100% rename from test_app/config.ru rename to tests/test_app/config.ru diff --git a/test_app/config/application.rb b/tests/test_app/config/application.rb similarity index 100% rename from test_app/config/application.rb rename to tests/test_app/config/application.rb diff --git a/test_app/config/boot.rb b/tests/test_app/config/boot.rb similarity index 100% rename from test_app/config/boot.rb rename to tests/test_app/config/boot.rb diff --git a/test_app/config/cucumber.yml b/tests/test_app/config/cucumber.yml similarity index 100% rename from test_app/config/cucumber.yml rename to tests/test_app/config/cucumber.yml diff --git a/test_app/config/database.yml b/tests/test_app/config/database.yml similarity index 100% rename from test_app/config/database.yml rename to tests/test_app/config/database.yml diff --git a/test_app/config/environment.rb b/tests/test_app/config/environment.rb similarity index 100% rename from test_app/config/environment.rb rename to tests/test_app/config/environment.rb diff --git a/test_app/config/environments/development.rb b/tests/test_app/config/environments/development.rb similarity index 100% rename from test_app/config/environments/development.rb rename to tests/test_app/config/environments/development.rb diff --git a/test_app/config/environments/pg_test.rb b/tests/test_app/config/environments/pg_test.rb similarity index 100% rename from test_app/config/environments/pg_test.rb rename to tests/test_app/config/environments/pg_test.rb diff --git a/test_app/config/environments/production.rb b/tests/test_app/config/environments/production.rb similarity index 100% rename from test_app/config/environments/production.rb rename to tests/test_app/config/environments/production.rb diff --git a/test_app/config/environments/test.rb b/tests/test_app/config/environments/test.rb similarity index 100% rename from test_app/config/environments/test.rb rename to tests/test_app/config/environments/test.rb diff --git a/test_app/config/initializers/backtrace_silencers.rb b/tests/test_app/config/initializers/backtrace_silencers.rb similarity index 100% rename from test_app/config/initializers/backtrace_silencers.rb rename to tests/test_app/config/initializers/backtrace_silencers.rb diff --git a/test_app/config/initializers/impression.rb b/tests/test_app/config/initializers/impression.rb similarity index 100% rename from test_app/config/initializers/impression.rb rename to tests/test_app/config/initializers/impression.rb diff --git a/test_app/config/initializers/inflections.rb b/tests/test_app/config/initializers/inflections.rb similarity index 100% rename from test_app/config/initializers/inflections.rb rename to tests/test_app/config/initializers/inflections.rb diff --git a/test_app/config/initializers/mime_types.rb b/tests/test_app/config/initializers/mime_types.rb similarity index 100% rename from test_app/config/initializers/mime_types.rb rename to tests/test_app/config/initializers/mime_types.rb diff --git a/test_app/config/initializers/secret_token.rb b/tests/test_app/config/initializers/secret_token.rb similarity index 100% rename from test_app/config/initializers/secret_token.rb rename to tests/test_app/config/initializers/secret_token.rb diff --git a/test_app/config/initializers/session_store.rb b/tests/test_app/config/initializers/session_store.rb similarity index 100% rename from test_app/config/initializers/session_store.rb rename to tests/test_app/config/initializers/session_store.rb diff --git a/test_app/config/initializers/wrap_parameters.rb b/tests/test_app/config/initializers/wrap_parameters.rb similarity index 100% rename from test_app/config/initializers/wrap_parameters.rb rename to tests/test_app/config/initializers/wrap_parameters.rb diff --git a/test_app/config/locales/en.yml b/tests/test_app/config/locales/en.yml similarity index 100% rename from test_app/config/locales/en.yml rename to tests/test_app/config/locales/en.yml diff --git a/test_app/config/routes.rb b/tests/test_app/config/routes.rb similarity index 100% rename from test_app/config/routes.rb rename to tests/test_app/config/routes.rb diff --git a/test_app/db/migrate/20110201153144_create_articles.rb b/tests/test_app/db/migrate/20110201153144_create_articles.rb similarity index 100% rename from test_app/db/migrate/20110201153144_create_articles.rb rename to tests/test_app/db/migrate/20110201153144_create_articles.rb diff --git a/test_app/db/migrate/20110210205028_create_posts.rb b/tests/test_app/db/migrate/20110210205028_create_posts.rb similarity index 100% rename from test_app/db/migrate/20110210205028_create_posts.rb rename to tests/test_app/db/migrate/20110210205028_create_posts.rb diff --git a/test_app/db/migrate/20111127184039_create_widgets.rb b/tests/test_app/db/migrate/20111127184039_create_widgets.rb similarity index 100% rename from test_app/db/migrate/20111127184039_create_widgets.rb rename to tests/test_app/db/migrate/20111127184039_create_widgets.rb diff --git a/tests/test_app/db/schema.rb b/tests/test_app/db/schema.rb new file mode 100644 index 0000000..b12fa39 --- /dev/null +++ b/tests/test_app/db/schema.rb @@ -0,0 +1,60 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended to check this file into your version control system. + +ActiveRecord::Schema.define(:version => 20130709003307) do + + create_table "articles", :force => true do |t| + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "impressions", :force => true do |t| + t.string "impressionable_type" + t.integer "impressionable_id" + t.integer "user_id" + t.string "controller_name" + t.string "action_name" + t.string "view_name" + t.string "request_hash" + t.string "ip_address" + t.string "session_hash" + t.text "message" + t.text "referrer" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "impressions", ["controller_name", "action_name", "ip_address"], :name => "controlleraction_ip_index" + add_index "impressions", ["controller_name", "action_name", "request_hash"], :name => "controlleraction_request_index" + add_index "impressions", ["controller_name", "action_name", "session_hash"], :name => "controlleraction_session_index" + add_index "impressions", ["impressionable_type", "impressionable_id", "ip_address"], :name => "poly_ip_index" + add_index "impressions", ["impressionable_type", "impressionable_id", "request_hash"], :name => "poly_request_index" + add_index "impressions", ["impressionable_type", "impressionable_id", "session_hash"], :name => "poly_session_index" + add_index "impressions", ["impressionable_type", "message", "impressionable_id"], :name => "impressionable_type_message_index" + add_index "impressions", ["user_id"], :name => "index_impressions_on_user_id" + + create_table "posts", :force => true do |t| + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "widgets", :force => true do |t| + t.string "name" + t.integer "impressions_count", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + +end diff --git a/test_app/db/seeds.rb b/tests/test_app/db/seeds.rb similarity index 100% rename from test_app/db/seeds.rb rename to tests/test_app/db/seeds.rb diff --git a/test_app/lib/assets/.gitkeep b/tests/test_app/lib/assets/.gitkeep similarity index 100% rename from test_app/lib/assets/.gitkeep rename to tests/test_app/lib/assets/.gitkeep diff --git a/test_app/lib/tasks/.gitkeep b/tests/test_app/lib/tasks/.gitkeep similarity index 100% rename from test_app/lib/tasks/.gitkeep rename to tests/test_app/lib/tasks/.gitkeep diff --git a/test_app/lib/tasks/cucumber.rake b/tests/test_app/lib/tasks/cucumber.rake similarity index 100% rename from test_app/lib/tasks/cucumber.rake rename to tests/test_app/lib/tasks/cucumber.rake diff --git a/test_app/log/.gitkeep b/tests/test_app/log/.gitkeep similarity index 100% rename from test_app/log/.gitkeep rename to tests/test_app/log/.gitkeep diff --git a/test_app/public/404.html b/tests/test_app/public/404.html similarity index 100% rename from test_app/public/404.html rename to tests/test_app/public/404.html diff --git a/test_app/public/422.html b/tests/test_app/public/422.html similarity index 100% rename from test_app/public/422.html rename to tests/test_app/public/422.html diff --git a/test_app/public/500.html b/tests/test_app/public/500.html similarity index 100% rename from test_app/public/500.html rename to tests/test_app/public/500.html diff --git a/test_app/public/favicon.ico b/tests/test_app/public/favicon.ico similarity index 100% rename from test_app/public/favicon.ico rename to tests/test_app/public/favicon.ico diff --git a/test_app/public/images/rails.png b/tests/test_app/public/images/rails.png similarity index 100% rename from test_app/public/images/rails.png rename to tests/test_app/public/images/rails.png diff --git a/test_app/public/index.html b/tests/test_app/public/index.html similarity index 100% rename from test_app/public/index.html rename to tests/test_app/public/index.html diff --git a/test_app/public/javascripts/application.js b/tests/test_app/public/javascripts/application.js similarity index 100% rename from test_app/public/javascripts/application.js rename to tests/test_app/public/javascripts/application.js diff --git a/test_app/public/javascripts/controls.js b/tests/test_app/public/javascripts/controls.js similarity index 100% rename from test_app/public/javascripts/controls.js rename to tests/test_app/public/javascripts/controls.js diff --git a/test_app/public/javascripts/dragdrop.js b/tests/test_app/public/javascripts/dragdrop.js similarity index 100% rename from test_app/public/javascripts/dragdrop.js rename to tests/test_app/public/javascripts/dragdrop.js diff --git a/test_app/public/javascripts/effects.js b/tests/test_app/public/javascripts/effects.js similarity index 100% rename from test_app/public/javascripts/effects.js rename to tests/test_app/public/javascripts/effects.js diff --git a/test_app/public/javascripts/prototype.js b/tests/test_app/public/javascripts/prototype.js similarity index 100% rename from test_app/public/javascripts/prototype.js rename to tests/test_app/public/javascripts/prototype.js diff --git a/test_app/public/javascripts/rails.js b/tests/test_app/public/javascripts/rails.js similarity index 100% rename from test_app/public/javascripts/rails.js rename to tests/test_app/public/javascripts/rails.js diff --git a/test_app/public/robots.txt b/tests/test_app/public/robots.txt similarity index 100% rename from test_app/public/robots.txt rename to tests/test_app/public/robots.txt diff --git a/test_app/public/stylesheets/.gitkeep b/tests/test_app/public/stylesheets/.gitkeep similarity index 100% rename from test_app/public/stylesheets/.gitkeep rename to tests/test_app/public/stylesheets/.gitkeep diff --git a/test_app/script/cucumber b/tests/test_app/script/cucumber similarity index 100% rename from test_app/script/cucumber rename to tests/test_app/script/cucumber diff --git a/test_app/script/rails b/tests/test_app/script/rails similarity index 100% rename from test_app/script/rails rename to tests/test_app/script/rails diff --git a/test_app/spec/controllers/articles_controller_spec.rb b/tests/test_app/spec/controllers/articles_controller_spec.rb similarity index 100% rename from test_app/spec/controllers/articles_controller_spec.rb rename to tests/test_app/spec/controllers/articles_controller_spec.rb diff --git a/test_app/spec/controllers/dummy_controller_spec.rb b/tests/test_app/spec/controllers/dummy_controller_spec.rb similarity index 100% rename from test_app/spec/controllers/dummy_controller_spec.rb rename to tests/test_app/spec/controllers/dummy_controller_spec.rb diff --git a/test_app/spec/controllers/impressionist_uniqueness_spec.rb b/tests/test_app/spec/controllers/impressionist_uniqueness_spec.rb similarity index 100% rename from test_app/spec/controllers/impressionist_uniqueness_spec.rb rename to tests/test_app/spec/controllers/impressionist_uniqueness_spec.rb diff --git a/test_app/spec/controllers/posts_controller_spec.rb b/tests/test_app/spec/controllers/posts_controller_spec.rb similarity index 100% rename from test_app/spec/controllers/posts_controller_spec.rb rename to tests/test_app/spec/controllers/posts_controller_spec.rb diff --git a/test_app/spec/controllers/widgets_controller_spec.rb b/tests/test_app/spec/controllers/widgets_controller_spec.rb similarity index 100% rename from test_app/spec/controllers/widgets_controller_spec.rb rename to tests/test_app/spec/controllers/widgets_controller_spec.rb diff --git a/test_app/spec/fixtures/articles.yml b/tests/test_app/spec/fixtures/articles.yml similarity index 100% rename from test_app/spec/fixtures/articles.yml rename to tests/test_app/spec/fixtures/articles.yml diff --git a/test_app/spec/fixtures/impressions.yml b/tests/test_app/spec/fixtures/impressions.yml similarity index 100% rename from test_app/spec/fixtures/impressions.yml rename to tests/test_app/spec/fixtures/impressions.yml diff --git a/test_app/spec/fixtures/posts.yml b/tests/test_app/spec/fixtures/posts.yml similarity index 100% rename from test_app/spec/fixtures/posts.yml rename to tests/test_app/spec/fixtures/posts.yml diff --git a/test_app/spec/fixtures/widgets.yml b/tests/test_app/spec/fixtures/widgets.yml similarity index 100% rename from test_app/spec/fixtures/widgets.yml rename to tests/test_app/spec/fixtures/widgets.yml diff --git a/test_app/spec/initializers/initializers_spec.rb b/tests/test_app/spec/initializers/initializers_spec.rb similarity index 100% rename from test_app/spec/initializers/initializers_spec.rb rename to tests/test_app/spec/initializers/initializers_spec.rb diff --git a/test_app/spec/models/bots_spec.rb b/tests/test_app/spec/models/bots_spec.rb similarity index 100% rename from test_app/spec/models/bots_spec.rb rename to tests/test_app/spec/models/bots_spec.rb diff --git a/test_app/spec/models/counter_caching_spec.rb b/tests/test_app/spec/models/counter_caching_spec.rb similarity index 100% rename from test_app/spec/models/counter_caching_spec.rb rename to tests/test_app/spec/models/counter_caching_spec.rb diff --git a/test_app/spec/models/model_spec.rb b/tests/test_app/spec/models/model_spec.rb similarity index 100% rename from test_app/spec/models/model_spec.rb rename to tests/test_app/spec/models/model_spec.rb diff --git a/test_app/spec/rails_generators/rails_generators_spec.rb b/tests/test_app/spec/rails_generators/rails_generators_spec.rb similarity index 100% rename from test_app/spec/rails_generators/rails_generators_spec.rb rename to tests/test_app/spec/rails_generators/rails_generators_spec.rb diff --git a/test_app/spec/spec_helper.rb b/tests/test_app/spec/spec_helper.rb similarity index 100% rename from test_app/spec/spec_helper.rb rename to tests/test_app/spec/spec_helper.rb