Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare test dependencies explicitly in gemspecs #2359

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions api/solidus_api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,14 @@ Gem::Specification.new do |gem|
gem.add_dependency 'responders'
gem.add_dependency 'jbuilder', '~> 2.6'
gem.add_dependency 'kaminari', '>= 0.17', '< 2.0'

gem.add_development_dependency 'timecop'
gem.add_development_dependency 'database_cleaner', '~> 1.3'
gem.add_development_dependency 'factory_bot', '~> 4.8'
gem.add_development_dependency 'rails-controller-testing'
gem.add_development_dependency 'rspec-activemodel-mocks', '~> 1.0.2'
gem.add_development_dependency 'rspec-rails', '~> 3.6.0'
gem.add_development_dependency 'rspec_junit_formatter'
gem.add_development_dependency 'simplecov'
gem.add_development_dependency 'with_model'
end
1 change: 1 addition & 0 deletions api/spec/requests/spree/api/shipments_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'spec_helper'
require 'timecop'

describe Spree::Api::ShipmentsController, type: :request do
let!(:shipment) { create(:shipment, inventory_units: [build(:inventory_unit, shipment: nil)]) }
Expand Down
5 changes: 5 additions & 0 deletions api/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@
require 'spree/testing_support/dummy_app'
DummyApp::Migrations.auto_migrate

require 'rails-controller-testing'
require 'rspec/rails'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each { |f| require f }

require 'with_model'
require 'database_cleaner'
require 'rspec-activemodel-mocks'

require 'spree/testing_support/factories'
require 'spree/testing_support/preferences'
require 'spree/testing_support/authorization_helpers'
Expand Down
12 changes: 12 additions & 0 deletions backend/solidus_backend.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,16 @@ Gem::Specification.new do |s|

s.add_dependency 'handlebars_assets', '~> 0.23'
s.add_dependency 'autoprefixer-rails', '~> 7.1'

s.add_development_dependency 'capybara', '~> 2.15'
s.add_development_dependency 'capybara-screenshot', '>= 1.0.18'
s.add_development_dependency 'database_cleaner', '~> 1.3'
s.add_development_dependency 'factory_bot', '~> 4.8'
s.add_development_dependency 'rails-controller-testing'
s.add_development_dependency 'rspec-activemodel-mocks', '~> 1.0.2'
s.add_development_dependency 'rspec-rails', '~> 3.6.0'
s.add_development_dependency 'rspec_junit_formatter'
s.add_development_dependency 'selenium-webdriver'
s.add_development_dependency 'simplecov'
s.add_development_dependency 'with_model'
end
1 change: 1 addition & 0 deletions backend/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

require 'database_cleaner'
require 'with_model'
require 'rspec-activemodel-mocks'

require 'spree/testing_support/authorization_helpers'
require 'spree/testing_support/factories'
Expand Down
23 changes: 1 addition & 22 deletions common_spree_dependencies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,9 @@
gem 'activerecord-jdbcsqlite3-adapter'
end

gem 'coffee-rails'
gem 'sass-rails'

group :test do
gem 'capybara', '~> 2.15'
gem 'capybara-screenshot', '>= 1.0.18'
gem 'database_cleaner', '~> 1.3'
gem 'factory_bot_rails', '~> 4.8'
gem 'launchy'
gem 'rspec-activemodel-mocks', '~>1.0.2'
gem 'rspec-rails', '~> 3.6.0'
gem 'simplecov'
gem 'poltergeist', '~> 1.9'
gem 'timecop'
gem 'with_model'
gem 'rspec_junit_formatter'
gem 'rails-controller-testing'
gem 'selenium-webdriver'
end

group :test, :development do
gem 'rubocop'
gem 'rubocop', require: false
gem 'pry'
gem 'listen', '~> 3.1.5'

platforms :mri do
gem 'byebug'
Expand Down
4 changes: 3 additions & 1 deletion core/config/initializers/assets.rb
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Rails.application.config.assets.precompile << 'solidus_core_manifest.js'
if Rails.application.config.respond_to?(:assets)
Copy link
Contributor

@ccarruitero ccarruitero Nov 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove this changes since are in #2358

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is built on top of #2358, which is necessary for this to pass.

Rails.application.config.assets.precompile << 'solidus_core_manifest.js'
end
6 changes: 4 additions & 2 deletions core/lib/spree/testing_support/dummy_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ class Application < ::Rails::Application

config.action_controller.include_all_helpers = false

config.assets.paths << File.expand_path('../dummy_app/assets/javascripts', __FILE__)
config.assets.paths << File.expand_path('../dummy_app/assets/stylesheets', __FILE__)
if config.respond_to?(:assets)
Copy link
Contributor

@ccarruitero ccarruitero Nov 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as comment above

config.assets.paths << File.expand_path('../dummy_app/assets/javascripts', __FILE__)
config.assets.paths << File.expand_path('../dummy_app/assets/stylesheets', __FILE__)
end

config.paths["config/database"] = File.expand_path('../dummy_app/database.yml', __FILE__)
config.paths['app/views'] = File.expand_path('../dummy_app/views', __FILE__)
Expand Down
1 change: 1 addition & 0 deletions core/lib/spree/testing_support/dummy_app/rake_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
rescue LoadError
end

require 'rails/command'
require 'rails/commands/console/console_command'
Rails::Console.new(Rails.application, sandbox: true, environment: "test").start
end
9 changes: 9 additions & 0 deletions core/solidus_core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,13 @@ Gem::Specification.new do |s|
s.add_dependency 'ransack', '~> 1.8'
s.add_dependency 'state_machines-activerecord', '~> 0.4'
s.add_dependency 'stringex', '~> 1.5.1'

s.add_development_dependency 'database_cleaner', '~> 1.3'
s.add_development_dependency 'factory_bot', '~> 4.8'
s.add_development_dependency 'rspec-activemodel-mocks', '~>1.0.2'
s.add_development_dependency 'rspec-rails', '~> 3.6.0'
s.add_development_dependency 'rspec_junit_formatter'
s.add_development_dependency 'simplecov'
s.add_development_dependency 'timecop'
s.add_development_dependency 'with_model'
end
2 changes: 2 additions & 0 deletions core/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
end
end

require 'rspec/core'

require 'spree/testing_support/preferences'
require 'spree/config'
require 'with_model'
Expand Down
10 changes: 10 additions & 0 deletions frontend/solidus_frontend.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,15 @@ Gem::Specification.new do |s|
s.add_dependency 'truncate_html', '~> 0.9', '>= 0.9.2'
s.add_dependency 'kaminari', '>= 0.17', '< 2.0'

s.add_development_dependency 'capybara', '~> 2.15'
s.add_development_dependency 'capybara-accessible'
s.add_development_dependency 'capybara-screenshot', '>= 1.0.18'
s.add_development_dependency 'database_cleaner', '~> 1.3'
s.add_development_dependency 'factory_bot', '~> 4.8'
s.add_development_dependency 'poltergeist', '~> 1.9'
s.add_development_dependency 'rails-controller-testing'
s.add_development_dependency 'rspec-activemodel-mocks', '~> 1.0.2'
s.add_development_dependency 'rspec-rails', '~> 3.6.0'
s.add_development_dependency 'rspec_junit_formatter'
s.add_development_dependency 'simplecov'
end
2 changes: 2 additions & 0 deletions frontend/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
require 'spree/testing_support/dummy_app'
DummyApp::Migrations.auto_migrate

require 'rails-controller-testing'
require 'rspec/rails'

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

require 'database_cleaner'
require 'rspec-activemodel-mocks'

require 'spree/testing_support/authorization_helpers'
require 'spree/testing_support/capybara_ext'
Expand Down
5 changes: 5 additions & 0 deletions sample/solidus_sample.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ Gem::Specification.new do |s|
s.required_rubygems_version = '>= 1.8.23'

s.add_dependency 'solidus_core', s.version

s.add_development_dependency 'database_cleaner', '~> 1.3'
s.add_development_dependency 'rspec-rails', '~> 3.6.0'
s.add_development_dependency 'rspec_junit_formatter'
s.add_development_dependency 'simplecov'
end
2 changes: 2 additions & 0 deletions sample/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

require 'rspec/rails'

require 'database_cleaner'

RSpec.configure do |config|
config.color = true
config.infer_spec_type_from_file_location!
Expand Down