|
41 | 41 | Braintree::Configuration.public_key = 'mwjkkxwcp32ckhnf' |
42 | 42 | Braintree::Configuration.private_key = 'a9298f43b30c699db3072cc4a00f7f49' |
43 | 43 | Braintree::Configuration.merchant_id = '7rdg92j7bm7fk5h3' |
| 44 | +Braintree::Configuration.logger = Rails.logger |
44 | 45 |
|
45 | 46 | VCR.configure do |c| |
46 | 47 | c.cassette_library_dir = "spec/fixtures/cassettes" |
|
50 | 51 | end |
51 | 52 |
|
52 | 53 | RSpec.configure do |config| |
53 | | - config.include FactoryGirl::Syntax::Methods |
54 | | - |
55 | | - # Infer an example group's spec type from the file location. |
56 | 54 | config.infer_spec_type_from_file_location! |
57 | | - |
58 | | - # == URL Helpers |
59 | | - # |
60 | | - # Allows access to Spree's routes in specs: |
61 | | - # |
62 | | - # visit spree.admin_path |
63 | | - # current_path.should eql(spree.products_path) |
64 | | - config.include Spree::TestingSupport::UrlHelpers |
65 | | - |
66 | | - # == Mock Framework |
67 | | - # |
68 | | - # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: |
69 | | - # |
70 | | - # config.mock_with :mocha |
71 | | - # config.mock_with :flexmock |
72 | | - # config.mock_with :rr |
73 | 55 | config.mock_with :rspec |
74 | | - config.color = true |
75 | | - |
76 | | - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures |
77 | | - config.fixture_path = "#{::Rails.root}/spec/fixtures" |
78 | 56 |
|
79 | | - # Capybara javascript drivers require transactional fixtures set to false, and we use DatabaseCleaner |
80 | | - # to cleanup after each test instead. Without transactional fixtures set to false the records created |
81 | | - # to setup a test will be unavailable to the browser, which runs under a separate server instance. |
| 57 | + config.filter_run focus: true |
| 58 | + config.run_all_when_everything_filtered = true |
82 | 59 | config.use_transactional_fixtures = false |
83 | 60 |
|
84 | | - # Ensure Suite is set to use transactions for speed. |
| 61 | + config.fail_fast = ENV['FAIL_FAST'] || false |
| 62 | + |
| 63 | + config.include FactoryGirl::Syntax::Methods |
| 64 | + config.include Spree::TestingSupport::UrlHelpers |
| 65 | + |
85 | 66 | config.before :suite do |
86 | 67 | DatabaseCleaner.strategy = :transaction |
87 | 68 | DatabaseCleaner.clean_with :truncation |
88 | 69 | end |
89 | 70 |
|
90 | | - # Before each spec check if it is a Javascript test and switch between using database transactions or not where necessary. |
91 | 71 | config.before :each do |
92 | 72 | DatabaseCleaner.strategy = RSpec.current_example.metadata[:js] ? :truncation : :transaction |
93 | 73 | DatabaseCleaner.start |
94 | 74 | end |
95 | 75 |
|
96 | | - # After each spec clean the database. |
97 | 76 | config.after :each do |
98 | 77 | DatabaseCleaner.clean |
99 | 78 | end |
100 | | - |
101 | | - config.fail_fast = ENV['FAIL_FAST'] || false |
102 | | - config.order = 'random' |
103 | 79 | end |
0 commit comments