cadenero 0.0.2.b5 → 0.0.2.b6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ require 'capybara/rspec'
7
7
  require 'factory_girl'
8
8
  require 'database_cleaner'
9
9
  require 'coveralls'
10
+ require 'cadenero/testing_support/database_cleaning'
10
11
 
11
12
  Coveralls.wear!
12
13
 
@@ -24,6 +25,7 @@ Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
24
25
 
25
26
  RSpec.configure do |config|
26
27
  include ApiHelper
28
+ config.include Cadenero::TestingSupport::DatabaseCleaning
27
29
  # ## Mock Framework
28
30
  #
29
31
  # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
@@ -38,7 +40,7 @@ RSpec.configure do |config|
38
40
  # If you're not using ActiveRecord, or you'd prefer not to run each of your
39
41
  # examples within a transaction, remove the following line or assign false
40
42
  # instead of true.
41
- config.use_transactional_fixtures = true
43
+ config.use_transactional_fixtures = false
42
44
 
43
45
  # If true, the base class of anonymous controllers will be inferred
44
46
  # automatically. This will be the default behavior in future versions of
@@ -51,28 +53,4 @@ RSpec.configure do |config|
51
53
  # --seed 1234
52
54
  config.order = "random"
53
55
 
54
- config.before(:suite) do
55
- DatabaseCleaner.strategy = :truncation
56
- DatabaseCleaner.clean_with(:truncation)
57
- header "Content-Type", "application/json"
58
- end
59
- config.before(:each) do
60
- DatabaseCleaner.start
61
- end
62
- config.after(:each) do
63
- Apartment::Database.reset
64
- DatabaseCleaner.clean
65
- connection = ActiveRecord::Base.connection.raw_connection
66
- schemas = connection.query(%Q{
67
- SELECT 'drop schema ' || nspname || ' cascade;'
68
- from pg_namespace
69
- where nspname != 'public'
70
- AND nspname != 'pg_toast'
71
- AND nspname != 'pg_catalog'
72
- AND nspname != 'information_schema';
73
- })
74
- schemas.each do |query|
75
- connection.query(query.values.first)
76
- end
77
- end
78
56
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cadenero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.b5
4
+ version: 0.0.2.b6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Vidaurre
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-15 00:00:00.000000000 Z
11
+ date: 2013-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails-api
@@ -231,6 +231,7 @@ files:
231
231
  - lib/cadenero/constraints/subdomain_required.rb
232
232
  - lib/cadenero/engine.rb
233
233
  - lib/cadenero/testing_support/authentication_helpers.rb
234
+ - lib/cadenero/testing_support/database_cleaning.rb
234
235
  - lib/cadenero/testing_support/subdomain_helpers.rb
235
236
  - lib/cadenero/version.rb
236
237
  - lib/cadenero.rb