forked from spree-contrib/spree_related_products
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
97 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
--color | ||
--color | ||
-r spec_helper | ||
-f documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
guard "rspec", cmd: "bundle exec rspec", all_on_start: true, all_after_pass: true do | ||
watch("spec/spec_helper.rb") { "spec" } | ||
watch("config/routes.rb") { "spec/controllers" } | ||
watch(%r{^spec/(.+)_spec\.rb$}) { |m| "spec/#{m[1]}_spec.rb"} | ||
guard 'rspec', cmd: 'bundle exec rspec' do | ||
watch('spec/spec_helper.rb') { 'spec' } | ||
watch('config/routes.rb') { 'spec/controllers' } | ||
watch(%r{^spec/(.+)_spec\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | ||
watch(%r{^app/(.+)_decorator\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | ||
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | ||
watch(%r{^app/(.*)(\.erb)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } | ||
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | ||
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb" } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
require 'spec_helper' | ||
|
||
describe Spree::Admin::RelationsController do | ||
stub_authorization! | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
spec/models/spree/calculator/related_product_discount_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
require 'spec_helper' | ||
|
||
describe Spree::Product do | ||
context 'class' do | ||
describe '.relation_types' do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,36 @@ | ||
require 'simplecov' | ||
SimpleCov.start 'rails' | ||
SimpleCov.start do | ||
add_filter 'spec' | ||
add_group 'Controllers', 'app/controllers' | ||
add_group 'Overrides', 'app/overrides' | ||
add_group 'Models', 'app/models' | ||
add_group 'Libraries', 'lib' | ||
end | ||
|
||
ENV['RAILS_ENV'] = 'test' | ||
ENV['RAILS_ENV'] ||= 'test' | ||
|
||
require File.expand_path('../dummy/config/environment.rb', __FILE__) | ||
begin | ||
require File.expand_path('../dummy/config/environment', __FILE__) | ||
rescue LoadError | ||
puts 'Could not load dummy application. Please ensure you have run `bundle exec rake test_app`' | ||
exit | ||
end | ||
|
||
require 'rspec/rails' | ||
require 'capybara/rspec' | ||
require 'capybara/rails' | ||
require 'capybara/poltergeist' | ||
require 'shoulda-matchers' | ||
require 'ffaker' | ||
require 'database_cleaner' | ||
|
||
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f } | ||
|
||
require 'spree/testing_support/factories' | ||
|
||
require 'spree/testing_support/controller_requests' | ||
require 'spree/testing_support/authorization_helpers' | ||
require 'spree/testing_support/url_helpers' | ||
require 'spree/testing_support/capybara_ext' | ||
|
||
FactoryGirl.find_definitions | ||
require 'pry' | ||
|
||
RSpec.configure do |config| | ||
config.include FactoryGirl::Syntax::Methods | ||
config.include Spree::TestingSupport::ControllerRequests, type: :controller | ||
config.include Spree::TestingSupport::UrlHelpers | ||
|
||
config.mock_with :rspec | ||
config.use_transactional_fixtures = false | ||
|
||
config.before do | ||
DatabaseCleaner.strategy = example.metadata[:js] ? :truncation : :transaction | ||
DatabaseCleaner.start | ||
end | ||
|
||
config.after do | ||
DatabaseCleaner.clean | ||
end | ||
|
||
Capybara.javascript_driver = :poltergeist | ||
config.fail_fast = false | ||
config.filter_run focus: true | ||
config.run_all_when_everything_filtered = true | ||
# config.raise_errors_for_deprecations! | ||
config.infer_spec_type_from_file_location! | ||
|
||
# config.expect_with :rspec do |expectations| | ||
# expectations.syntax = :expect | ||
# end | ||
end | ||
|
||
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |file| require file } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'capybara/rspec' | ||
require 'capybara/rails' | ||
require 'capybara/poltergeist' | ||
|
||
RSpec.configure do |config| | ||
Capybara.javascript_driver = :poltergeist | ||
|
||
Capybara.register_driver(:poltergeist) do |app| | ||
Capybara::Poltergeist::Driver.new app, js_errors: true, timeout: 30 | ||
end | ||
|
||
config.before(:each, :js) do | ||
if Capybara.javascript_driver == :selenium | ||
page.driver.browser.manage.window.maximize | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'database_cleaner' | ||
|
||
RSpec.configure do |config| | ||
|
||
config.before(:suite) do | ||
DatabaseCleaner.clean_with :truncation | ||
end | ||
|
||
config.before do | ||
DatabaseCleaner.strategy = :transaction | ||
end | ||
|
||
config.before(:each, :js) do | ||
DatabaseCleaner.strategy = :truncation | ||
end | ||
|
||
config.before do | ||
DatabaseCleaner.start | ||
end | ||
|
||
config.after do | ||
DatabaseCleaner.clean | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'factory_girl' | ||
|
||
FactoryGirl.find_definitions | ||
|
||
RSpec.configure do |config| | ||
config.include FactoryGirl::Syntax::Methods | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require 'spree/testing_support/factories' | ||
require 'spree/testing_support/controller_requests' | ||
require 'spree/testing_support/authorization_helpers' | ||
require 'spree/testing_support/url_helpers' | ||
require 'spree/testing_support/capybara_ext' | ||
|
||
RSpec.configure do |config| | ||
config.include Spree::TestingSupport::ControllerRequests | ||
config.include Spree::TestingSupport::UrlHelpers | ||
end |