Configure Travis, remove spork, add simplecov, add turbo sprokets.

Add travis config
(cherry picked from commit e3fdb12289)

Only build on Ruby 1.9.3
(cherry picked from commit 719ef386bf)

Exclude pry from CI build
(cherry picked from commit d60935c800)

Conflicts:

	Gemfile

Attempt 2
(cherry picked from commit 2b19253895)

Conflicts:

	Gemfile.lock

Configure travis for postgres
(cherry picked from commit 3a441cd7d9)

Fix migrations that fail because of coupling to changed/removed models
(cherry picked from commit b030793f15)

Set up xvfb for Travis
(cherry picked from commit cdc3ab09a1)

Add a failing test to test travis
(cherry picked from commit 72aa8fe5e5)

Revert "Add a failing test to test travis"

This reverts commit 72aa8fe5e5.
(cherry picked from commit bd5533e2b1)

Add simplecov
(cherry picked from commit 5089d3bb22)

Conflicts:

	Gemfile.lock

Add turbo sprockets for faster asset precompile
(cherry picked from commit 3e6c56a638)

Remove spork
(cherry picked from commit ed7bded642)

Conflicts:

	spec/spec_helper.rb

Remove more spork-specific things, remove unused cuc config from zeus
(cherry picked from commit fa11ff8982)

Ensure order decorator is required, fix test fragility
(cherry picked from commit 1e94f88c5e)
This commit is contained in:
Rohan Mitchell
2013-02-24 17:36:19 +11:00
parent 249e1e013f
commit cbeffaced1
14 changed files with 112 additions and 74 deletions

View File

@@ -160,7 +160,7 @@ module OpenFoodWeb
applicator.send(:update_exchange, sender.id, receiver.id, {:variant_ids => [variant1.id, variant3.id]})
exchange.reload
exchange.variant_ids.should == [variant1.id, variant3.id]
exchange.variant_ids.sort.should == [variant1.id, variant3.id].sort
applicator.send(:touched_exchanges).should == [exchange]
end
end

View File

@@ -1,68 +1,60 @@
require 'simplecov'
SimpleCov.start
require 'rubygems'
require 'spork'
#uncomment the following line to use spork with the debugger
#require 'spork/ext/ruby-debug'
# By default, test on eaterprises deployment settings
# This must be set before rails loads so that it's available in engine initializers
ENV['OFW_DEPLOYMENT'] ||= 'eaterprises'
Spork.prefork do
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'capybara'
require 'database_cleaner'
ENV["RAILS_ENV"] = 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'capybara'
require 'database_cleaner'
# 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}
require 'spree/core/testing_support/controller_requests'
# 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}
require 'spree/core/testing_support/controller_requests'
require 'active_record/fixtures'
fixtures_dir = File.expand_path('../../db/default', __FILE__)
ActiveRecord::Fixtures.create_fixtures(fixtures_dir, ['spree/states', 'spree/countries'])
require 'active_record/fixtures'
fixtures_dir = File.expand_path('../../db/default', __FILE__)
ActiveRecord::Fixtures.create_fixtures(fixtures_dir, ['spree/states', 'spree/countries'])
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
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"
# 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 = false
# 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
# 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
# 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
# ## Filters
#
config.filter_run_excluding :skip => true
# ## Filters
#
config.filter_run_excluding :skip => true
config.before(:each) do
if example.metadata[:js]
DatabaseCleaner.strategy = :truncation, { :except => ['spree_countries', 'spree_states'] }
else
DatabaseCleaner.strategy = :transaction
end
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
config.before(:each) do
if example.metadata[:js]
DatabaseCleaner.strategy = :truncation, { :except => ['spree_countries', 'spree_states'] }
else
DatabaseCleaner.strategy = :transaction
end
config.before(:each) do
@@ -74,18 +66,20 @@ Spork.prefork do
config.include Spree::UrlHelpers
config.include Spree::Core::TestingSupport::ControllerRequests, :type => :controller
config.include Devise::TestHelpers, :type => :controller
DatabaseCleaner.start
end
end
Spork.each_run do
Dir["#{File.dirname(__FILE__)}/../app/**/*.rb"].each {|f| load f}
Dir["#{File.dirname(__FILE__)}/../lib/**/*.rb"].each {|f| load f}
config.after(:each) do
DatabaseCleaner.clean
end
Rails.application.reload_routes!
config.include Rails.application.routes.url_helpers
config.include Spree::UrlHelpers
config.include Spree::Core::TestingSupport::ControllerRequests, :type => :controller
config.include Devise::TestHelpers, :type => :controller
# Factory girl
require 'factory_girl_rails'
RSpec.configure do |config|
config.include FactoryGirl::Syntax::Methods
end
config.include FactoryGirl::Syntax::Methods
end