diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..53607ea --- /dev/null +++ b/.rspec @@ -0,0 +1 @@ +--colour diff --git a/Gemfile b/Gemfile index e8a00e7..70c8333 100644 --- a/Gemfile +++ b/Gemfile @@ -8,6 +8,11 @@ gem 'rails', '3.1.3' gem 'mysql2' +group :development do + gem 'rspec-rails','2.6.1' +end + + # Gems used only for assets and not required # in production environments by default. group :assets do @@ -31,6 +36,8 @@ gem 'jquery-rails' # gem 'ruby-debug19', :require => 'ruby-debug' group :test do + gem 'rspec-rails','2.6.1' + gem 'webrat','0.7.1' # Pretty printed test output gem 'turn', '~> 0.8.3', :require => false end diff --git a/Gemfile.lock b/Gemfile.lock index 5ff9c53..6cad405 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,6 +39,7 @@ GEM coffee-script-source execjs coffee-script-source (1.2.0) + diff-lcs (1.1.3) erubis (2.7.0) execjs (1.3.0) multi_json (~> 1.0) @@ -55,6 +56,7 @@ GEM mime-types (1.17.2) multi_json (1.1.0) mysql2 (0.3.11) + nokogiri (1.5.2) polyglot (0.3.3) rack (1.3.6) rack-cache (1.2) @@ -83,6 +85,19 @@ GEM rake (0.9.2.2) rdoc (3.12) json (~> 1.4) + rspec (2.6.0) + rspec-core (~> 2.6.0) + rspec-expectations (~> 2.6.0) + rspec-mocks (~> 2.6.0) + rspec-core (2.6.4) + rspec-expectations (2.6.0) + diff-lcs (~> 1.1.2) + rspec-mocks (2.6.0) + rspec-rails (2.6.1) + actionpack (~> 3.0) + activesupport (~> 3.0) + railties (~> 3.0) + rspec (~> 2.6.0) sass (3.1.15) sass-rails (3.1.5) actionpack (~> 3.1.0) @@ -104,6 +119,10 @@ GEM uglifier (1.2.3) execjs (>= 0.3.0) multi_json (>= 1.0.2) + webrat (0.7.1) + nokogiri (>= 1.2.0) + rack (>= 1.0) + rack-test (>= 0.5.3) PLATFORMS ruby @@ -113,6 +132,8 @@ DEPENDENCIES jquery-rails mysql2 rails (= 3.1.3) + rspec-rails (= 2.6.1) sass-rails (~> 3.1.5) turn (~> 0.8.3) uglifier (>= 1.0.3) + webrat (= 0.7.1) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..9b8b02c --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,27 @@ +# 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' + +# 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 + config.mock_with :rspec + + # 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 +end