Permalink
Browse files

- Set up rspec for testing

- Force older version of devise to match the original user migrations that use helpers.
  • Loading branch information...
1 parent 2d978b3 commit 86b9ccfc9ec4c88195bd3b1af6717ab38b325a42 @jkronz jkronz committed Nov 25, 2012
View
@@ -0,0 +1 @@
+--color
View
@@ -3,13 +3,16 @@ source 'http://rubygems.org'
gem 'rails', '3.1.4'
gem 'pg'
-gem 'devise'
+gem 'devise', '1.5.3'
gem 'jquery-rails', '1.0.12'
gem 'compass-rails'
gem 'sass-rails'
gem 'uglifier'
+group :development, :test do
+ gem 'rspec-rails', ">= 2.0.0.beta"
+end
group :production do
gem 'therubyracer-heroku', '0.8.1.pre3'
end
View
@@ -39,11 +39,11 @@ GEM
sass (~> 3.1)
compass-rails (1.0.3)
compass (>= 0.12.2, < 0.14)
- devise (2.1.2)
+ devise (1.5.3)
bcrypt-ruby (~> 3.0)
- orm_adapter (~> 0.1)
- railties (~> 3.1)
- warden (~> 1.2.1)
+ orm_adapter (~> 0.0.3)
+ warden (~> 1.1)
+ diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
@@ -60,7 +60,7 @@ GEM
treetop (~> 1.4.8)
mime-types (1.19)
multi_json (1.3.7)
- orm_adapter (0.4.0)
+ orm_adapter (0.0.7)
pg (0.14.1)
polyglot (0.3.3)
rack (1.3.6)
@@ -87,9 +87,20 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
- rake (10.0.0)
+ rake (10.0.2)
rdoc (3.12)
json (~> 1.4)
+ rspec-core (2.12.0)
+ rspec-expectations (2.12.0)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.12.0)
+ rspec-rails (2.12.0)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ railties (>= 3.0)
+ rspec-core (~> 2.12.0)
+ rspec-expectations (~> 2.12.0)
+ rspec-mocks (~> 2.12.0)
sass (3.2.3)
sass-rails (3.1.6)
actionpack (~> 3.1.0)
@@ -118,10 +129,11 @@ PLATFORMS
DEPENDENCIES
compass-rails
- devise
+ devise (= 1.5.3)
jquery-rails (= 1.0.12)
pg
rails (= 3.1.4)
+ rspec-rails (>= 2.0.0.beta)
sass-rails
therubyracer-heroku (= 0.8.1.pre3)
uglifier
View
@@ -5,3 +5,11 @@ development:
pool: 5
timeout: 5000
username: postgres
+
+test:
+ adapter: postgresql
+ encoding: unicode
+ database: tubalr-test
+ pool: 5
+ timeout: 5000
+ username: postgres
@@ -0,0 +1,7 @@
+require 'spec_helper'
+
+describe "Playlist" do
+ it "should sort playlists" do
+ true.should be_true
+ end
+end
View
@@ -0,0 +1,38 @@
+# This file is copied to spec/ when you run 'rails generate rspec:install'
+ENV["RAILS_ENV"] ||= 'test'
+require File.expand_path("../../config/environment", __FILE__)
+require 'rspec/rails'
+require 'rspec/autorun'
+
+# Requires supporting ruby files with custom matchers and macros, etc,
+# in spec/support/ and its subdirectories.
+Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+
+RSpec.configure do |config|
+ # ## Mock Framework
+ #
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
+
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
+ # examples within a transaction, remove the following line or assign false
+ # instead of true.
+ config.use_transactional_fixtures = true
+
+ # If true, the base class of anonymous controllers will be inferred
+ # automatically. This will be the default behavior in future versions of
+ # rspec-rails.
+ config.infer_base_class_for_anonymous_controllers = false
+
+ # Run specs in random order to surface order dependencies. If you find an
+ # order dependency and want to debug it, you can fix the order by providing
+ # the seed, which is printed after each run.
+ # --seed 1234
+ config.order = "random"
+end
@@ -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
@@ -1,11 +0,0 @@
-# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
-
-one:
- user_id: 1
- video_id: MyString
- video_title: MyString
-
-two:
- user_id: 1
- video_id: MyString
- video_title: MyString
@@ -1,9 +0,0 @@
-# Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html
-
-one:
- playlist_name: MyString
- user_id: 1
-
-two:
- playlist_name: MyString
- user_id: 1
@@ -1,9 +0,0 @@
-# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
-
-one:
- what: MyString
- who: MyString
-
-two:
- what: MyString
- who: MyString
@@ -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
@@ -1,9 +0,0 @@
-# Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html
-
-one:
- video_id: MyString
- who: MyString
-
-two:
- video_id: MyString
- who: MyString
@@ -1,11 +0,0 @@
-# Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html
-
-one:
- video_title: MyString
- video_id: MyString
- playlist_id: 1
-
-two:
- video_title: MyString
- video_id: MyString
- playlist_id: 1
@@ -1,8 +0,0 @@
-require 'test_helper'
-
-class FavoritesControllerTest < ActionController::TestCase
- # Replace this with your real tests.
- test "the truth" do
- assert true
- end
-end
@@ -1,9 +0,0 @@
-require 'test_helper'
-require 'rails/performance_test_help'
-
-# Profiling results for each test method are written to tmp/performance.
-class BrowsingTest < ActionDispatch::PerformanceTest
- def test_homepage
- get '/'
- end
-end
View
@@ -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
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class BannedVideosTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
-end
@@ -1,8 +0,0 @@
-require 'test_helper'
-
-class FavoritesTest < ActiveSupport::TestCase
- # Replace this with your real tests.
- test "the truth" do
- assert true
- end
-end
@@ -1,4 +0,0 @@
-require 'test_helper'
-
-class FavoritesHelperTest < ActionView::TestCase
-end
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class PlaylistTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
-end
@@ -1,8 +0,0 @@
-require 'test_helper'
-
-class PlaylistsTest < ActiveSupport::TestCase
- # Replace this with your real tests.
- test "the truth" do
- assert true
- end
-end
@@ -1,8 +0,0 @@
-require 'test_helper'
-
-class SearchesTest < ActiveSupport::TestCase
- # Replace this with your real tests.
- test "the truth" do
- assert true
- end
-end
@@ -1,8 +0,0 @@
-require 'test_helper'
-
-class UserTest < ActiveSupport::TestCase
- # Replace this with your real tests.
- test "the truth" do
- assert true
- end
-end
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class VideoTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
-end
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class VideoViewTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
-end

0 comments on commit 86b9ccf

Please sign in to comment.