Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding spork and factory_girl_rails gems for testing

  • Loading branch information...
commit 6a9ebe55b3ae311942c9265d7906bd961da60785 1 parent 7db80c7
@chrisbloom7 chrisbloom7 authored
Showing with 84 additions and 41 deletions.
  1. +3 −1 .rspec
  2. +10 −0 Gemfile
  3. +22 −0 Gemfile.lock
  4. +49 −40 spec/spec_helper.rb
View
4 .rspec
@@ -1 +1,3 @@
---color
+--colour
+--drb
+--format documentation
View
10 Gemfile
@@ -38,7 +38,17 @@ gem 'grape', '~> 0.2.2'
# Javascript engine
gem 'therubyracer'
+group :development do
+ gem 'spork-rails'
+ gem 'thin'
+end
+
+group :test do
+ gem "accept_values_for", "~> 0.4.3"
+end
+
group :test, :development do
+ gem 'factory_girl_rails', '~> 4.1.0'
gem 'rails-erd'
gem 'rspec-rails'
gem 'ruby-debug19'
View
22 Gemfile.lock
@@ -10,6 +10,9 @@ GIT
GEM
remote: https://rubygems.org/
specs:
+ accept_values_for (0.4.3)
+ activemodel (>= 3.0.0)
+ rspec
actionmailer (3.2.8)
actionpack (= 3.2.8)
mail (~> 2.4.4)
@@ -67,6 +70,7 @@ GEM
execjs
coffee-script-source (1.3.3)
columnize (0.3.6)
+ daemons (1.1.9)
devise (2.1.2)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
@@ -74,8 +78,14 @@ GEM
warden (~> 1.2.1)
diff-lcs (1.1.3)
erubis (2.7.0)
+ eventmachine (1.0.0)
execjs (1.4.0)
multi_json (~> 1.0)
+ factory_girl (4.1.0)
+ activesupport (>= 3.0.0)
+ factory_girl_rails (4.1.0)
+ factory_girl (~> 4.1.0)
+ railties (>= 3.0.0)
grape (0.2.2)
activesupport
hashie (~> 1.2)
@@ -186,12 +196,20 @@ GEM
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
+ spork (1.0.0rc3)
+ spork-rails (3.2.0)
+ rails (>= 3.0.0, < 3.3.0)
+ spork (>= 1.0rc0)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
therubyracer (0.10.2)
libv8 (~> 3.3.10)
+ thin (1.5.0)
+ daemons (>= 1.0.9)
+ eventmachine (>= 0.12.6)
+ rack (>= 1.0.0)
thor (0.16.0)
tilt (1.3.3)
treetop (1.4.11)
@@ -210,6 +228,7 @@ PLATFORMS
ruby
DEPENDENCIES
+ accept_values_for (~> 0.4.3)
activerecord-postgis-adapter
activerecord-postgres-hstore!
audited
@@ -219,6 +238,7 @@ DEPENDENCIES
capistrano-ext
coffee-rails (~> 3.2.1)
devise (~> 2.1)
+ factory_girl_rails (~> 4.1.0)
grape (~> 0.2.2)
jquery-rails
pg
@@ -229,5 +249,7 @@ DEPENDENCIES
ruby-debug19
rvm-capistrano
sass-rails (~> 3.2.3)
+ spork-rails
therubyracer
+ thin
uglifier (>= 1.0.3)
View
89 spec/spec_helper.rb
@@ -1,42 +1,51 @@
-# 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"
+require 'spork'
+
+Spork.prefork do
+ # 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'
+ require 'accept_values_for'
+
+ # 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"
- config.include RSpec::Rails::RequestExampleGroup, :type => :request, :example_group => {
- :file_path => /spec\/api/
- }
+ config.include RSpec::Rails::RequestExampleGroup, :type => :request, :example_group => {
+ :file_path => /spec\/api/
+ }
+ end
end
+
+Spork.each_run do
+ FactoryGirl.reload
+end
Please sign in to comment.
Something went wrong with that request. Please try again.