From 25dbb834751500abd884addb036b26d1b56ad913 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Sun, 19 May 2013 08:46:46 +0100 Subject: [PATCH] Add rspec and remove test dir. --- Gemfile | 8 ++++ Gemfile.lock | 36 +++++++++++++++ test/fixtures/.gitkeep | 0 test/fixtures/admin_users.yml | 11 ----- test/fixtures/categories.yml | 9 ---- test/fixtures/contacts.yml | 11 ----- test/fixtures/pages.yml | 11 ----- test/fixtures/photos.yml | 19 -------- test/functional/.gitkeep | 0 .../functional/admin/admin_controller_test.rb | 7 --- .../admin/admin_users_controller_test.rb | 8 ---- .../admin/categories_controller_test.rb | 8 ---- .../admin/dashboard_controller_test.rb | 7 --- .../admin/downloads_controller_test.rb | 7 --- .../functional/admin/pages_controller_test.rb | 8 ---- .../admin/photos_controller_test.rb | 8 ---- .../admin/unlocks_controller_test.rb | 7 --- test/functional/categories_controller_test.rb | 45 ------------------- test/functional/contacts_controller_test.rb | 8 ---- test/functional/home_controller_test.rb | 7 --- test/functional/notifier_test.rb | 8 ---- test/functional/pages_controller_test.rb | 8 ---- test/functional/photos_controller_test.rb | 8 ---- test/integration/.gitkeep | 0 test/performance/browsing_test.rb | 12 ----- test/test_helper.rb | 13 ------ test/unit/.gitkeep | 0 test/unit/admin_user_test.rb | 7 --- test/unit/category_test.rb | 8 ---- test/unit/contact_test.rb | 8 ---- test/unit/helpers/admin/admin_helper_test.rb | 4 -- .../helpers/admin/dashboard_helper_test.rb | 4 -- .../helpers/admin/downloads_helper_test.rb | 4 -- .../unit/helpers/admin/unlocks_helper_test.rb | 4 -- test/unit/helpers/categories_helper_test.rb | 4 -- test/unit/helpers/contacts_helper_test.rb | 4 -- test/unit/helpers/home_helper_test.rb | 4 -- test/unit/helpers/pages_helper_test.rb | 4 -- test/unit/helpers/photos_helper_test.rb | 4 -- test/unit/page_test.rb | 8 ---- test/unit/photo_test.rb | 8 ---- 41 files changed, 44 insertions(+), 305 deletions(-) delete mode 100644 test/fixtures/.gitkeep delete mode 100644 test/fixtures/admin_users.yml delete mode 100644 test/fixtures/categories.yml delete mode 100644 test/fixtures/contacts.yml delete mode 100644 test/fixtures/pages.yml delete mode 100644 test/fixtures/photos.yml delete mode 100644 test/functional/.gitkeep delete mode 100644 test/functional/admin/admin_controller_test.rb delete mode 100644 test/functional/admin/admin_users_controller_test.rb delete mode 100644 test/functional/admin/categories_controller_test.rb delete mode 100644 test/functional/admin/dashboard_controller_test.rb delete mode 100644 test/functional/admin/downloads_controller_test.rb delete mode 100644 test/functional/admin/pages_controller_test.rb delete mode 100644 test/functional/admin/photos_controller_test.rb delete mode 100644 test/functional/admin/unlocks_controller_test.rb delete mode 100644 test/functional/categories_controller_test.rb delete mode 100644 test/functional/contacts_controller_test.rb delete mode 100644 test/functional/home_controller_test.rb delete mode 100644 test/functional/notifier_test.rb delete mode 100644 test/functional/pages_controller_test.rb delete mode 100644 test/functional/photos_controller_test.rb delete mode 100644 test/integration/.gitkeep delete mode 100644 test/performance/browsing_test.rb delete mode 100644 test/test_helper.rb delete mode 100644 test/unit/.gitkeep delete mode 100644 test/unit/admin_user_test.rb delete mode 100644 test/unit/category_test.rb delete mode 100644 test/unit/contact_test.rb delete mode 100644 test/unit/helpers/admin/admin_helper_test.rb delete mode 100644 test/unit/helpers/admin/dashboard_helper_test.rb delete mode 100644 test/unit/helpers/admin/downloads_helper_test.rb delete mode 100644 test/unit/helpers/admin/unlocks_helper_test.rb delete mode 100644 test/unit/helpers/categories_helper_test.rb delete mode 100644 test/unit/helpers/contacts_helper_test.rb delete mode 100644 test/unit/helpers/home_helper_test.rb delete mode 100644 test/unit/helpers/pages_helper_test.rb delete mode 100644 test/unit/helpers/photos_helper_test.rb delete mode 100644 test/unit/page_test.rb delete mode 100644 test/unit/photo_test.rb diff --git a/Gemfile b/Gemfile index 1214cd6..f77e214 100644 --- a/Gemfile +++ b/Gemfile @@ -43,6 +43,14 @@ group :development do gem 'yaml_db' end +group :test do + gem 'factory_girl_rails' + gem 'shoulda-matchers' + gem 'poltergeist', git: 'git://github.com/jonleighton/poltergeist.git' + gem 'fivemat' + gem 'capybara-screenshot' +end + gem "newrelic_rpm" gem 'sass-rails', "~> 3.2.0" diff --git a/Gemfile.lock b/Gemfile.lock index 37e1685..6600545 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,12 @@ +GIT + remote: git://github.com/jonleighton/poltergeist.git + revision: 7dee7758a03d4636c2a74b04a8b7bf8495319217 + specs: + poltergeist (1.3.0) + capybara (~> 2.1.0) + faye-websocket (>= 0.4.4, < 0.5.0) + http_parser.rb (~> 0.5.3) + GIT remote: git://github.com/rails/exception_notification revision: 192a49a02d63d28b23ed41cebadfedd490929cf1 @@ -58,6 +67,14 @@ GEM binding_of_caller (0.6.9) debug_inspector (>= 0.0.1) 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) + capybara-screenshot (0.3.6) + capybara (>= 1.0, < 3) cocaine (0.4.2) coderay (1.0.8) coffee-rails (3.2.2) @@ -74,14 +91,24 @@ GEM railties (~> 3.1) warden (~> 1.2.1) erubis (2.7.0) + eventmachine (1.0.3) execjs (1.4.0) multi_json (~> 1.0) expression_parser (0.9.0) + factory_girl (4.2.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.2.1) + factory_girl (~> 4.2.0) + railties (>= 3.0.0) + faye-websocket (0.4.7) + eventmachine (>= 0.12.0) + fivemat (1.2.1) formtastic (2.2.1) actionpack (>= 3.0) haml (3.1.7) hike (1.2.1) hpricot (0.8.6) + http_parser.rb (0.5.3) i18n (0.6.1) journey (1.0.4) jquery-rails (2.2.0) @@ -143,6 +170,8 @@ GEM sass (>= 3.1.10) tilt (~> 1.3) sexp_processor (4.1.4) + shoulda-matchers (2.1.0) + activesupport (>= 3.0.0) sprockets (2.2.2) hike (~> 1.2) multi_json (~> 1.0) @@ -172,6 +201,8 @@ GEM expression_parser wikitext (2.1.1) will_paginate (3.0.4) + xpath (2.0.0) + nokogiri (~> 1.3) yaml_db (0.2.3) PLATFORMS @@ -182,9 +213,12 @@ DEPENDENCIES aws-sdk better_errors binding_of_caller + capybara-screenshot coffee-rails (~> 3.2.0) devise exception_notification! + factory_girl_rails + fivemat formtastic haml hpricot @@ -192,11 +226,13 @@ DEPENDENCIES newrelic_rpm paperclip pg + poltergeist! powder rails (~> 3.2.0) rdiscount ruby_parser sass-rails (~> 3.2.0) + shoulda-matchers sqlite3-ruby squeel uglifier diff --git a/test/fixtures/.gitkeep b/test/fixtures/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/test/fixtures/admin_users.yml b/test/fixtures/admin_users.yml deleted file mode 100644 index 5394fa3..0000000 --- a/test/fixtures/admin_users.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/categories.yml b/test/fixtures/categories.yml deleted file mode 100644 index ef34764..0000000 --- a/test/fixtures/categories.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html - -one: - name: MyString - description: MyText - -two: - name: MyString - description: MyText diff --git a/test/fixtures/contacts.yml b/test/fixtures/contacts.yml deleted file mode 100644 index 2893341..0000000 --- a/test/fixtures/contacts.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/pages.yml b/test/fixtures/pages.yml deleted file mode 100644 index 2893341..0000000 --- a/test/fixtures/pages.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/photos.yml b/test/fixtures/photos.yml deleted file mode 100644 index 503b341..0000000 --- a/test/fixtures/photos.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html - -one: - category_id: 1 - content_type: MyString - filename: MyString - thumbnail: MyString - size: 1 - width: 1 - height: 1 - -two: - category_id: 1 - content_type: MyString - filename: MyString - thumbnail: MyString - size: 1 - width: 1 - height: 1 diff --git a/test/functional/.gitkeep b/test/functional/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/test/functional/admin/admin_controller_test.rb b/test/functional/admin/admin_controller_test.rb deleted file mode 100644 index d32ccbb..0000000 --- a/test/functional/admin/admin_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class Admin::AdminControllerTest < ActionController::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/functional/admin/admin_users_controller_test.rb b/test/functional/admin/admin_users_controller_test.rb deleted file mode 100644 index 17ee182..0000000 --- a/test/functional/admin/admin_users_controller_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test_helper' - -class Admin::AdminUsersControllerTest < ActionController::TestCase - # Replace this with your real tests. - test "the truth" do - assert true - end -end diff --git a/test/functional/admin/categories_controller_test.rb b/test/functional/admin/categories_controller_test.rb deleted file mode 100644 index cfc3d47..0000000 --- a/test/functional/admin/categories_controller_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test_helper' - -class Admin::CategoriesControllerTest < ActionController::TestCase - # Replace this with your real tests. - test "the truth" do - assert true - end -end diff --git a/test/functional/admin/dashboard_controller_test.rb b/test/functional/admin/dashboard_controller_test.rb deleted file mode 100644 index 2b0b8a1..0000000 --- a/test/functional/admin/dashboard_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class Admin::DashboardControllerTest < ActionController::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/functional/admin/downloads_controller_test.rb b/test/functional/admin/downloads_controller_test.rb deleted file mode 100644 index 2cc27e1..0000000 --- a/test/functional/admin/downloads_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class Admin::DownloadsControllerTest < ActionController::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/functional/admin/pages_controller_test.rb b/test/functional/admin/pages_controller_test.rb deleted file mode 100644 index 34e2fb7..0000000 --- a/test/functional/admin/pages_controller_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test_helper' - -class Admin::PagesControllerTest < ActionController::TestCase - # Replace this with your real tests. - test "the truth" do - assert true - end -end diff --git a/test/functional/admin/photos_controller_test.rb b/test/functional/admin/photos_controller_test.rb deleted file mode 100644 index a4bd4d9..0000000 --- a/test/functional/admin/photos_controller_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test_helper' - -class Admin::PhotosControllerTest < ActionController::TestCase - # Replace this with your real tests. - test "the truth" do - assert true - end -end diff --git a/test/functional/admin/unlocks_controller_test.rb b/test/functional/admin/unlocks_controller_test.rb deleted file mode 100644 index 2cd3d95..0000000 --- a/test/functional/admin/unlocks_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class Admin::UnlocksControllerTest < ActionController::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/functional/categories_controller_test.rb b/test/functional/categories_controller_test.rb deleted file mode 100644 index 8388fe5..0000000 --- a/test/functional/categories_controller_test.rb +++ /dev/null @@ -1,45 +0,0 @@ -require 'test_helper' - -class CategoriesControllerTest < ActionController::TestCase - test "should get index" do - get :index - assert_response :success - assert_not_nil assigns(:categories) - end - - test "should get new" do - get :new - assert_response :success - end - - test "should create category" do - assert_difference('Category.count') do - post :create, :category => { } - end - - assert_redirected_to category_path(assigns(:category)) - end - - test "should show category" do - get :show, :id => categories(:one).to_param - assert_response :success - end - - test "should get edit" do - get :edit, :id => categories(:one).to_param - assert_response :success - end - - test "should update category" do - put :update, :id => categories(:one).to_param, :category => { } - assert_redirected_to category_path(assigns(:category)) - end - - test "should destroy category" do - assert_difference('Category.count', -1) do - delete :destroy, :id => categories(:one).to_param - end - - assert_redirected_to categories_path - end -end diff --git a/test/functional/contacts_controller_test.rb b/test/functional/contacts_controller_test.rb deleted file mode 100644 index 2422ab7..0000000 --- a/test/functional/contacts_controller_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test_helper' - -class ContactsControllerTest < ActionController::TestCase - # Replace this with your real tests. - test "the truth" do - assert true - end -end diff --git a/test/functional/home_controller_test.rb b/test/functional/home_controller_test.rb deleted file mode 100644 index 730478d..0000000 --- a/test/functional/home_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class HomeControllerTest < ActionController::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/functional/notifier_test.rb b/test/functional/notifier_test.rb deleted file mode 100644 index 368b7aa..0000000 --- a/test/functional/notifier_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test_helper' - -class NotifierTest < ActionMailer::TestCase - # replace this with your real tests - test "the truth" do - assert true - end -end diff --git a/test/functional/pages_controller_test.rb b/test/functional/pages_controller_test.rb deleted file mode 100644 index 5ad8c34..0000000 --- a/test/functional/pages_controller_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test_helper' - -class PagesControllerTest < ActionController::TestCase - # Replace this with your real tests. - test "the truth" do - assert true - end -end diff --git a/test/functional/photos_controller_test.rb b/test/functional/photos_controller_test.rb deleted file mode 100644 index 16082ce..0000000 --- a/test/functional/photos_controller_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test_helper' - -class PhotosControllerTest < ActionController::TestCase - # Replace this with your real tests. - test "the truth" do - assert true - end -end diff --git a/test/integration/.gitkeep b/test/integration/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb deleted file mode 100644 index 3fea27b..0000000 --- a/test/performance/browsing_test.rb +++ /dev/null @@ -1,12 +0,0 @@ -require 'test_helper' -require 'rails/performance_test_help' - -class BrowsingTest < ActionDispatch::PerformanceTest - # Refer to the documentation for all available options - # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory] - # :output => 'tmp/performance', :formats => [:flat] } - - def test_homepage - get '/' - end -end diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index 8bf1192..0000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,13 +0,0 @@ -ENV["RAILS_ENV"] = "test" -require File.expand_path('../../config/environment', __FILE__) -require 'rails/test_help' - -class ActiveSupport::TestCase - # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. - # - # Note: You'll currently still have to declare fixtures explicitly in integration tests - # -- they do not yet inherit this setting - fixtures :all - - # Add more helper methods to be used by all tests here... -end diff --git a/test/unit/.gitkeep b/test/unit/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/test/unit/admin_user_test.rb b/test/unit/admin_user_test.rb deleted file mode 100644 index 6215c04..0000000 --- a/test/unit/admin_user_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class AdminUserTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/unit/category_test.rb b/test/unit/category_test.rb deleted file mode 100644 index 233dacb..0000000 --- a/test/unit/category_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test_helper' - -class CategoryTest < ActiveSupport::TestCase - # Replace this with your real tests. - test "the truth" do - assert true - end -end diff --git a/test/unit/contact_test.rb b/test/unit/contact_test.rb deleted file mode 100644 index ee7d2ca..0000000 --- a/test/unit/contact_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test_helper' - -class ContactTest < ActiveSupport::TestCase - # Replace this with your real tests. - test "the truth" do - assert true - end -end diff --git a/test/unit/helpers/admin/admin_helper_test.rb b/test/unit/helpers/admin/admin_helper_test.rb deleted file mode 100644 index 28ed129..0000000 --- a/test/unit/helpers/admin/admin_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class Admin::AdminHelperTest < ActionView::TestCase -end diff --git a/test/unit/helpers/admin/dashboard_helper_test.rb b/test/unit/helpers/admin/dashboard_helper_test.rb deleted file mode 100644 index 70e2bb0..0000000 --- a/test/unit/helpers/admin/dashboard_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class Admin::DashboardHelperTest < ActionView::TestCase -end diff --git a/test/unit/helpers/admin/downloads_helper_test.rb b/test/unit/helpers/admin/downloads_helper_test.rb deleted file mode 100644 index 2ad3995..0000000 --- a/test/unit/helpers/admin/downloads_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class Admin::DownloadsHelperTest < ActionView::TestCase -end diff --git a/test/unit/helpers/admin/unlocks_helper_test.rb b/test/unit/helpers/admin/unlocks_helper_test.rb deleted file mode 100644 index d4d5215..0000000 --- a/test/unit/helpers/admin/unlocks_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class Admin::UnlocksHelperTest < ActionView::TestCase -end diff --git a/test/unit/helpers/categories_helper_test.rb b/test/unit/helpers/categories_helper_test.rb deleted file mode 100644 index 0b03c47..0000000 --- a/test/unit/helpers/categories_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class CategoriesHelperTest < ActionView::TestCase -end diff --git a/test/unit/helpers/contacts_helper_test.rb b/test/unit/helpers/contacts_helper_test.rb deleted file mode 100644 index c41d1ac..0000000 --- a/test/unit/helpers/contacts_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class ContactsHelperTest < ActionView::TestCase -end diff --git a/test/unit/helpers/home_helper_test.rb b/test/unit/helpers/home_helper_test.rb deleted file mode 100644 index 4740a18..0000000 --- a/test/unit/helpers/home_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class HomeHelperTest < ActionView::TestCase -end diff --git a/test/unit/helpers/pages_helper_test.rb b/test/unit/helpers/pages_helper_test.rb deleted file mode 100644 index 535dfe1..0000000 --- a/test/unit/helpers/pages_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class PagesHelperTest < ActionView::TestCase -end diff --git a/test/unit/helpers/photos_helper_test.rb b/test/unit/helpers/photos_helper_test.rb deleted file mode 100644 index 989a82c..0000000 --- a/test/unit/helpers/photos_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class PhotosHelperTest < ActionView::TestCase -end diff --git a/test/unit/page_test.rb b/test/unit/page_test.rb deleted file mode 100644 index b12dd9a..0000000 --- a/test/unit/page_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test_helper' - -class PageTest < ActiveSupport::TestCase - # Replace this with your real tests. - test "the truth" do - assert true - end -end diff --git a/test/unit/photo_test.rb b/test/unit/photo_test.rb deleted file mode 100644 index 8b6482e..0000000 --- a/test/unit/photo_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test_helper' - -class PhotoTest < ActiveSupport::TestCase - # Replace this with your real tests. - test "the truth" do - assert true - end -end