Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed Spork. Updated capybara.

  • Loading branch information...
commit b2aa0680603208a23d48f0ee87a4c2b699f8f241 1 parent 26ffe08
@steveyken steveyken authored
Showing with 90 additions and 111 deletions.
  1. +0 −1  Gemfile
  2. +8 −8 Gemfile.lock
  3. +82 −102 spec/spec_helper.rb
View
1  Gemfile
@@ -60,7 +60,6 @@ end
group :test do
gem 'capybara', '~> 1.1' # v2 and up is not r1.8 compatible.
- gem 'spork'
gem 'database_cleaner'
gem "acts_as_fu", "~> 0.0.8"
View
16 Gemfile.lock
@@ -55,7 +55,7 @@ GEM
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
capistrano_colors (0.5.5)
- capybara (1.1.3)
+ capybara (1.1.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
@@ -103,7 +103,7 @@ GEM
factory_girl (~> 3.0.0)
railties (>= 3.0.0)
ffaker (1.14.0)
- ffi (1.1.5)
+ ffi (1.2.0)
haml (3.1.7)
headless (0.2.2)
highline (1.6.15)
@@ -117,8 +117,9 @@ GEM
json (1.7.5)
kgio (2.7.4)
libv8 (3.3.10.4)
- libwebsocket (0.1.5)
+ libwebsocket (0.1.7.1)
addressable
+ websocket
linecache (0.46)
rbx-require-relative (> 0.0.4)
mail (2.4.4)
@@ -127,7 +128,7 @@ GEM
treetop (~> 1.4.8)
method_source (0.7.1)
mime-types (1.19)
- multi_json (1.3.7)
+ multi_json (1.5.0)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-sftp (2.0.5)
@@ -135,7 +136,7 @@ GEM
net-ssh (2.6.1)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
- nokogiri (1.5.5)
+ nokogiri (1.5.6)
paper_trail (2.6.3)
activerecord (~> 3.0)
railties (~> 3.0)
@@ -231,7 +232,7 @@ GEM
tilt (~> 1.3)
select2-rails (3.2.1)
thor (~> 0.14)
- selenium-webdriver (2.26.0)
+ selenium-webdriver (2.27.2)
childprocess (>= 0.2.5)
libwebsocket (~> 0.1.3)
multi_json (~> 1.0)
@@ -240,7 +241,6 @@ GEM
actionpack (~> 3.0)
activemodel (~> 3.0)
slop (2.4.4)
- spork (0.9.1)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
@@ -270,6 +270,7 @@ GEM
raindrops (~> 0.7)
valium (0.5.0)
activerecord (>= 3.0.2)
+ websocket (1.0.6)
will_paginate (3.0.3)
xpath (0.1.4)
nokogiri (~> 1.3)
@@ -320,7 +321,6 @@ DEPENDENCIES
sass-rails (~> 3.2.3)
select2-rails
simple_form (~> 2.0.1)
- spork
therubyracer
thin
turbo-sprockets-rails3
View
184 spec/spec_helper.rb
@@ -1,128 +1,108 @@
require 'rubygems'
-require 'spork'
-Spork.prefork do
- # Loading more in this block will cause your tests to run faster. However,
- # if you change any configuration or code from libraries loaded here, you'll
- # need to restart spork for it take effect.
+ENV["RAILS_ENV"] = 'test'
+require File.expand_path("../../config/environment", __FILE__)
+require 'rspec/rails'
+require 'rspec/autorun'
- if ENV["COVERAGE"]
- require 'simplecov'
- SimpleCov.start 'rails'
- end
-
- # 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 'acts_as_fu'
+require 'factory_girl'
+require 'ffaker'
- require 'acts_as_fu'
- # Load factories
- require 'factory_girl'
- require 'ffaker'
+# 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 File.expand_path(f) }
- # 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 File.expand_path(f) }
+# Load shared behavior modules to be included by Runner config.
+Dir[File.dirname(__FILE__) + "/shared/*.rb"].each{ |f| require File.expand_path(f) }
- # Load shared behavior modules to be included by Runner config.
- Dir[File.dirname(__FILE__) + "/shared/*.rb"].each{ |f| require File.expand_path(f) }
+TASK_STATUSES = %w(pending assigned completed).freeze
+OPPORTUNITY_STATUSES = %w(prospecting analysis presentation proposal negotiation final_review won lost).freeze
+Setting[:opportunity_stage] = OPPORTUNITY_STATUSES
- TASK_STATUSES = %w(pending assigned completed).freeze
- OPPORTUNITY_STATUSES = %w(prospecting analysis presentation proposal negotiation final_review won lost).freeze
- Setting[:opportunity_stage] = OPPORTUNITY_STATUSES
+I18n.locale = 'en-US'
- I18n.locale = 'en-US'
+Paperclip.options[:log] = false
- Paperclip.options[:log] = false
+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
- 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
+ config.fixture_path = "#{Rails.root}/spec/fixtures"
- config.fixture_path = "#{Rails.root}/spec/fixtures"
+ # RSpec configuration options for Fat Free CRM.
+ config.include RSpec::Rails::Matchers
+ config.include(SharedControllerSpecs, :type => :controller)
+ config.include(SharedModelSpecs, :type => :model)
- # RSpec configuration options for Fat Free CRM.
- config.include RSpec::Rails::Matchers
- config.include(SharedControllerSpecs, :type => :controller)
- config.include(SharedModelSpecs, :type => :model)
+ config.before(:each) do
+ PaperTrail.enabled = false
- config.before(:each) do
- PaperTrail.enabled = false
+ # Overwrite locale settings within "config/settings.yml" if necessary.
+ # In order to ensure that test still pass if "Setting.locale" is not set to "en-US".
+ I18n.locale = 'en-US'
+ Setting.locale = 'en-US' unless Setting.locale == 'en-US'
+ end
- # Overwrite locale settings within "config/settings.yml" if necessary.
- # In order to ensure that test still pass if "Setting.locale" is not set to "en-US".
- I18n.locale = 'en-US'
- Setting.locale = 'en-US' unless Setting.locale == 'en-US'
- end
+ # 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 = false
+ config.before :suite do
+ DatabaseCleaner.strategy = :transaction
+ DatabaseCleaner.clean_with(:truncation)
+ end
+ config.before :all, :type => :request do
+ DatabaseCleaner.clean_with(:truncation)
+ end
+ config.around :each, :type => :request do |example|
+ DatabaseCleaner.strategy = :truncation
+ example.run
+ DatabaseCleaner.strategy = :transaction
+ end
+ config.around :each do |example|
+ DatabaseCleaner.start
+ example.run
+ DatabaseCleaner.clean
+ end
- # 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 = false
- config.before :suite do
- DatabaseCleaner.strategy = :transaction
- DatabaseCleaner.clean_with(:truncation)
- end
- config.before :all, :type => :request do
- DatabaseCleaner.clean_with(:truncation)
- end
- config.around :each, :type => :request do |example|
- DatabaseCleaner.strategy = :truncation
- example.run
- DatabaseCleaner.strategy = :transaction
- end
- config.around :each do |example|
- DatabaseCleaner.start
- example.run
- DatabaseCleaner.clean
- end
+ # config.before :all, :type => :view do
+ # view.lookup_context.prefixes << 'entities'
+ # end
- # config.before :all, :type => :view do
- # view.lookup_context.prefixes << 'entities'
- # end
+ # 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
+end
- # 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
+ActionView::TestCase::TestController.class_eval do
+ def controller_name
+ request.path_parameters["controller"].split('/').last
end
+end
- ActionView::TestCase::TestController.class_eval do
- def controller_name
- request.path_parameters["controller"].split('/').last
- end
+ActionView::Base.class_eval do
+ def controller_name
+ HashWithIndifferentAccess.new(request.path_parameters)["controller"].split('/').last
end
- ActionView::Base.class_eval do
- def controller_name
- HashWithIndifferentAccess.new(request.path_parameters)["controller"].split('/').last
- end
-
- def called_from_index_page?(controller = controller_name)
- if controller != "tasks"
- request.referer =~ %r(/#{controller}$)
- else
- request.referer =~ /tasks\?*/
- end
- end
-
- def called_from_landing_page?(controller = controller_name)
- request.referer =~ %r(/#{controller}/\w+)
+ def called_from_index_page?(controller = controller_name)
+ if controller != "tasks"
+ request.referer =~ %r(/#{controller}$)
+ else
+ request.referer =~ /tasks\?*/
end
end
-end # Spork.prefork
-
-
-Spork.each_run do
- Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+ def called_from_landing_page?(controller = controller_name)
+ request.referer =~ %r(/#{controller}/\w+)
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.