sandboxy 1.1.1 → 2.0.0

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.
Files changed (138) hide show
  1. checksums.yaml +5 -5
  2. data/.github/pull_request_template.md +2 -2
  3. data/CHANGELOG.md +6 -0
  4. data/CODE_OF_CONDUCT.md +1 -1
  5. data/DEPRECATIONS.md +3 -1
  6. data/Gemfile +1 -1
  7. data/INSTALL.md +1 -1
  8. data/LICENSE +1 -1
  9. data/README.md +68 -38
  10. data/Rakefile +0 -1
  11. data/examples/rails_example/Gemfile +1 -0
  12. data/examples/rails_example/app/api/books/api.rb +33 -0
  13. data/examples/rails_example/app/assets/javascripts/{bars.coffee → applications.coffee} +0 -0
  14. data/examples/rails_example/app/assets/javascripts/{foos.coffee → authors.coffee} +0 -0
  15. data/examples/rails_example/app/assets/javascripts/books.coffee +3 -0
  16. data/examples/rails_example/app/assets/javascripts/libraries.coffee +3 -0
  17. data/examples/rails_example/app/assets/javascripts/sandbox.coffee +3 -0
  18. data/examples/rails_example/app/assets/stylesheets/applications.scss +3 -0
  19. data/examples/rails_example/app/assets/stylesheets/{foos.scss → authors.scss} +1 -1
  20. data/examples/rails_example/app/assets/stylesheets/{bars.scss → books.scss} +1 -1
  21. data/examples/rails_example/app/assets/stylesheets/libraries.scss +3 -0
  22. data/examples/rails_example/app/assets/stylesheets/sandbox.scss +3 -0
  23. data/examples/rails_example/app/controllers/application_controller.rb +5 -1
  24. data/examples/rails_example/app/controllers/applications_controller.rb +74 -0
  25. data/examples/rails_example/app/controllers/authors_controller.rb +77 -0
  26. data/examples/rails_example/app/controllers/books_controller.rb +77 -0
  27. data/examples/rails_example/app/controllers/libraries_controller.rb +77 -0
  28. data/examples/rails_example/app/controllers/sandbox_controller.rb +6 -0
  29. data/examples/rails_example/app/helpers/applications_helper.rb +2 -0
  30. data/examples/rails_example/app/helpers/authors_helper.rb +2 -0
  31. data/examples/rails_example/app/helpers/books_helper.rb +2 -0
  32. data/examples/rails_example/app/helpers/libraries_helper.rb +2 -0
  33. data/examples/rails_example/app/helpers/sandbox_helper.rb +2 -0
  34. data/examples/rails_example/app/models/application.rb +14 -0
  35. data/examples/rails_example/app/models/author.rb +2 -0
  36. data/examples/rails_example/app/models/book.rb +2 -0
  37. data/examples/rails_example/app/models/library.rb +2 -0
  38. data/examples/rails_example/app/views/applications/_application.json.jbuilder +2 -0
  39. data/examples/rails_example/app/views/applications/_form.html.erb +19 -0
  40. data/examples/rails_example/app/views/applications/edit.html.erb +6 -0
  41. data/examples/rails_example/app/views/applications/index.html.erb +25 -0
  42. data/examples/rails_example/app/views/applications/index.json.jbuilder +1 -0
  43. data/examples/rails_example/app/views/applications/new.html.erb +5 -0
  44. data/examples/rails_example/app/views/applications/show.html.erb +7 -0
  45. data/examples/rails_example/app/views/applications/show.json.jbuilder +1 -0
  46. data/examples/rails_example/app/views/authors/_author.json.jbuilder +2 -0
  47. data/examples/rails_example/app/views/authors/_form.html.erb +19 -0
  48. data/examples/rails_example/app/views/authors/edit.html.erb +6 -0
  49. data/examples/rails_example/app/views/authors/index.html.erb +25 -0
  50. data/examples/rails_example/app/views/authors/index.json.jbuilder +1 -0
  51. data/examples/rails_example/app/views/authors/new.html.erb +5 -0
  52. data/examples/rails_example/app/views/authors/show.html.erb +4 -0
  53. data/examples/rails_example/app/views/authors/show.json.jbuilder +1 -0
  54. data/examples/rails_example/app/views/books/_book.json.jbuilder +2 -0
  55. data/examples/rails_example/app/views/books/_form.html.erb +19 -0
  56. data/examples/rails_example/app/views/books/edit.html.erb +6 -0
  57. data/examples/rails_example/app/views/books/index.html.erb +25 -0
  58. data/examples/rails_example/app/views/books/index.json.jbuilder +1 -0
  59. data/examples/rails_example/app/views/books/new.html.erb +5 -0
  60. data/examples/rails_example/app/views/books/show.html.erb +4 -0
  61. data/examples/rails_example/app/views/books/show.json.jbuilder +1 -0
  62. data/examples/rails_example/app/views/libraries/_form.html.erb +19 -0
  63. data/examples/rails_example/app/views/libraries/_library.json.jbuilder +2 -0
  64. data/examples/rails_example/app/views/libraries/edit.html.erb +6 -0
  65. data/examples/rails_example/app/views/libraries/index.html.erb +25 -0
  66. data/examples/rails_example/app/views/libraries/index.json.jbuilder +1 -0
  67. data/examples/rails_example/app/views/libraries/new.html.erb +5 -0
  68. data/examples/rails_example/app/views/libraries/show.html.erb +4 -0
  69. data/examples/rails_example/app/views/libraries/show.json.jbuilder +1 -0
  70. data/examples/rails_example/config/initializers/grape.rb +2 -0
  71. data/examples/rails_example/config/initializers/sandboxy.rb +13 -0
  72. data/examples/rails_example/config/routes.rb +9 -3
  73. data/examples/rails_example/config/secrets.yml +2 -2
  74. data/examples/rails_example/db/migrate/20170827184048_create_books.rb +9 -0
  75. data/examples/rails_example/db/migrate/20170827184054_create_authors.rb +9 -0
  76. data/examples/rails_example/db/migrate/20170827184106_create_libraries.rb +9 -0
  77. data/examples/rails_example/db/migrate/20170827184304_create_applications.rb +11 -0
  78. data/examples/rails_example/db/migrate/{20170827105828_sandboxy_migration.rb → 20170827190815_sandboxy_migration.rb} +0 -0
  79. data/examples/rails_example/db/schema.rb +19 -3
  80. data/examples/rails_example/test/controllers/applications_controller_test.rb +48 -0
  81. data/examples/rails_example/test/controllers/authors_controller_test.rb +48 -0
  82. data/examples/rails_example/test/controllers/books_controller_test.rb +48 -0
  83. data/examples/rails_example/test/controllers/libraries_controller_test.rb +48 -0
  84. data/examples/rails_example/test/controllers/sandbox_controller_test.rb +7 -0
  85. data/examples/rails_example/test/fixtures/{bars.yml → applications.yml} +0 -0
  86. data/examples/rails_example/test/fixtures/{foos.yml → authors.yml} +0 -0
  87. data/examples/rails_example/test/fixtures/books.yml +11 -0
  88. data/examples/rails_example/test/fixtures/libraries.yml +11 -0
  89. data/examples/rails_example/test/models/application_test.rb +7 -0
  90. data/examples/rails_example/test/models/{bar_test.rb → author_test.rb} +1 -1
  91. data/examples/rails_example/test/models/{foo_test.rb → book_test.rb} +1 -1
  92. data/examples/rails_example/test/models/library_test.rb +7 -0
  93. data/examples/rails_example/test/system/applications_test.rb +9 -0
  94. data/examples/rails_example/test/system/authors_test.rb +9 -0
  95. data/examples/rails_example/test/system/books_test.rb +9 -0
  96. data/examples/rails_example/test/system/libraries_test.rb +9 -0
  97. data/lib/generators/sandboxy_generator.rb +4 -6
  98. data/lib/generators/templates/initializer.rb +13 -0
  99. data/lib/sandboxy/configuration.rb +11 -34
  100. data/lib/sandboxy/middleware.rb +3 -3
  101. data/lib/sandboxy/railtie.rb +3 -3
  102. data/lib/sandboxy/version.rb +1 -1
  103. data/lib/sandboxy.rb +12 -3
  104. data/sandboxy.gemspec +4 -6
  105. data/test/dummy30/config/initializers/sandboxy.rb +13 -0
  106. data/test/test_helper.rb +0 -2
  107. metadata +93 -78
  108. data/examples/rails_example/app/controllers/bars_controller.rb +0 -74
  109. data/examples/rails_example/app/controllers/foos_controller.rb +0 -74
  110. data/examples/rails_example/app/helpers/bars_helper.rb +0 -2
  111. data/examples/rails_example/app/helpers/foos_helper.rb +0 -2
  112. data/examples/rails_example/app/models/bar.rb +0 -2
  113. data/examples/rails_example/app/models/foo.rb +0 -2
  114. data/examples/rails_example/app/models/shared_sandbox.rb +0 -3
  115. data/examples/rails_example/app/views/bars/_bar.json.jbuilder +0 -2
  116. data/examples/rails_example/app/views/bars/_form.html.erb +0 -17
  117. data/examples/rails_example/app/views/bars/edit.html.erb +0 -6
  118. data/examples/rails_example/app/views/bars/index.html.erb +0 -25
  119. data/examples/rails_example/app/views/bars/index.json.jbuilder +0 -1
  120. data/examples/rails_example/app/views/bars/new.html.erb +0 -5
  121. data/examples/rails_example/app/views/bars/show.html.erb +0 -4
  122. data/examples/rails_example/app/views/bars/show.json.jbuilder +0 -1
  123. data/examples/rails_example/app/views/foos/_foo.json.jbuilder +0 -2
  124. data/examples/rails_example/app/views/foos/_form.html.erb +0 -17
  125. data/examples/rails_example/app/views/foos/edit.html.erb +0 -6
  126. data/examples/rails_example/app/views/foos/index.html.erb +0 -25
  127. data/examples/rails_example/app/views/foos/index.json.jbuilder +0 -1
  128. data/examples/rails_example/app/views/foos/new.html.erb +0 -5
  129. data/examples/rails_example/app/views/foos/show.html.erb +0 -4
  130. data/examples/rails_example/app/views/foos/show.json.jbuilder +0 -1
  131. data/examples/rails_example/config/sandboxy.yml +0 -13
  132. data/examples/rails_example/db/migrate/20170826223227_create_foos.rb +0 -8
  133. data/examples/rails_example/db/migrate/20170826223243_create_bars.rb +0 -8
  134. data/examples/rails_example/test/controllers/bars_controller_test.rb +0 -48
  135. data/examples/rails_example/test/controllers/foos_controller_test.rb +0 -48
  136. data/examples/rails_example/test/system/bars_test.rb +0 -9
  137. data/examples/rails_example/test/system/foos_test.rb +0 -9
  138. data/lib/generators/templates/configuration.yml.erb +0 -13
@@ -0,0 +1,48 @@
1
+ require 'test_helper'
2
+
3
+ class AuthorsControllerTest < ActionDispatch::IntegrationTest
4
+ setup do
5
+ @author = authors(:one)
6
+ end
7
+
8
+ test "should get index" do
9
+ get authors_url
10
+ assert_response :success
11
+ end
12
+
13
+ test "should get new" do
14
+ get new_author_url
15
+ assert_response :success
16
+ end
17
+
18
+ test "should create author" do
19
+ assert_difference('Author.count') do
20
+ post authors_url, params: { author: { } }
21
+ end
22
+
23
+ assert_redirected_to author_url(Author.last)
24
+ end
25
+
26
+ test "should show author" do
27
+ get author_url(@author)
28
+ assert_response :success
29
+ end
30
+
31
+ test "should get edit" do
32
+ get edit_author_url(@author)
33
+ assert_response :success
34
+ end
35
+
36
+ test "should update author" do
37
+ patch author_url(@author), params: { author: { } }
38
+ assert_redirected_to author_url(@author)
39
+ end
40
+
41
+ test "should destroy author" do
42
+ assert_difference('Author.count', -1) do
43
+ delete author_url(@author)
44
+ end
45
+
46
+ assert_redirected_to authors_url
47
+ end
48
+ end
@@ -0,0 +1,48 @@
1
+ require 'test_helper'
2
+
3
+ class BooksControllerTest < ActionDispatch::IntegrationTest
4
+ setup do
5
+ @book = books(:one)
6
+ end
7
+
8
+ test "should get index" do
9
+ get books_url
10
+ assert_response :success
11
+ end
12
+
13
+ test "should get new" do
14
+ get new_book_url
15
+ assert_response :success
16
+ end
17
+
18
+ test "should create book" do
19
+ assert_difference('Book.count') do
20
+ post books_url, params: { book: { } }
21
+ end
22
+
23
+ assert_redirected_to book_url(Book.last)
24
+ end
25
+
26
+ test "should show book" do
27
+ get book_url(@book)
28
+ assert_response :success
29
+ end
30
+
31
+ test "should get edit" do
32
+ get edit_book_url(@book)
33
+ assert_response :success
34
+ end
35
+
36
+ test "should update book" do
37
+ patch book_url(@book), params: { book: { } }
38
+ assert_redirected_to book_url(@book)
39
+ end
40
+
41
+ test "should destroy book" do
42
+ assert_difference('Book.count', -1) do
43
+ delete book_url(@book)
44
+ end
45
+
46
+ assert_redirected_to books_url
47
+ end
48
+ end
@@ -0,0 +1,48 @@
1
+ require 'test_helper'
2
+
3
+ class LibrariesControllerTest < ActionDispatch::IntegrationTest
4
+ setup do
5
+ @library = libraries(:one)
6
+ end
7
+
8
+ test "should get index" do
9
+ get libraries_url
10
+ assert_response :success
11
+ end
12
+
13
+ test "should get new" do
14
+ get new_library_url
15
+ assert_response :success
16
+ end
17
+
18
+ test "should create library" do
19
+ assert_difference('Library.count') do
20
+ post libraries_url, params: { library: { } }
21
+ end
22
+
23
+ assert_redirected_to library_url(Library.last)
24
+ end
25
+
26
+ test "should show library" do
27
+ get library_url(@library)
28
+ assert_response :success
29
+ end
30
+
31
+ test "should get edit" do
32
+ get edit_library_url(@library)
33
+ assert_response :success
34
+ end
35
+
36
+ test "should update library" do
37
+ patch library_url(@library), params: { library: { } }
38
+ assert_redirected_to library_url(@library)
39
+ end
40
+
41
+ test "should destroy library" do
42
+ assert_difference('Library.count', -1) do
43
+ delete library_url(@library)
44
+ end
45
+
46
+ assert_redirected_to libraries_url
47
+ end
48
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class SandboxControllerTest < ActionDispatch::IntegrationTest
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ # This model initially had no columns defined. If you add columns to the
4
+ # model remove the '{}' from the fixture names and add the columns immediately
5
+ # below each fixture, per the syntax in the comments below
6
+ #
7
+ one: {}
8
+ # column: value
9
+ #
10
+ two: {}
11
+ # column: value
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ # This model initially had no columns defined. If you add columns to the
4
+ # model remove the '{}' from the fixture names and add the columns immediately
5
+ # below each fixture, per the syntax in the comments below
6
+ #
7
+ one: {}
8
+ # column: value
9
+ #
10
+ two: {}
11
+ # column: value
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class ApplicationTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class BarTest < ActiveSupport::TestCase
3
+ class AuthorTest < ActiveSupport::TestCase
4
4
  # test "the truth" do
5
5
  # assert true
6
6
  # end
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class FooTest < ActiveSupport::TestCase
3
+ class BookTest < ActiveSupport::TestCase
4
4
  # test "the truth" do
5
5
  # assert true
6
6
  # end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class LibraryTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,9 @@
1
+ require "application_system_test_case"
2
+
3
+ class ApplicationsTest < ApplicationSystemTestCase
4
+ # test "visiting the index" do
5
+ # visit applications_url
6
+ #
7
+ # assert_selector "h1", text: "Application"
8
+ # end
9
+ end
@@ -0,0 +1,9 @@
1
+ require "application_system_test_case"
2
+
3
+ class AuthorsTest < ApplicationSystemTestCase
4
+ # test "visiting the index" do
5
+ # visit authors_url
6
+ #
7
+ # assert_selector "h1", text: "Author"
8
+ # end
9
+ end
@@ -0,0 +1,9 @@
1
+ require "application_system_test_case"
2
+
3
+ class BooksTest < ApplicationSystemTestCase
4
+ # test "visiting the index" do
5
+ # visit books_url
6
+ #
7
+ # assert_selector "h1", text: "Book"
8
+ # end
9
+ end
@@ -0,0 +1,9 @@
1
+ require "application_system_test_case"
2
+
3
+ class LibrariesTest < ApplicationSystemTestCase
4
+ # test "visiting the index" do
5
+ # visit libraries_url
6
+ #
7
+ # assert_selector "h1", text: "Library"
8
+ # end
9
+ end
@@ -7,8 +7,6 @@ class SandboxyGenerator < Rails::Generators::Base
7
7
 
8
8
  source_root File.join File.dirname(__FILE__), 'templates'
9
9
  desc 'Install sandboxy'
10
- class_option :default, desc: 'Set to default environment. Accepts either `live` or `sandbox`.', type: :boolean, default: false, aliases: '-d'
11
- class_option :retain_environment, desc: "Whether your app should retain it's environment at runtime on new requests.", type: :boolean, default: false, aliases: '-re'
12
10
 
13
11
  def self.next_migration_number dirname
14
12
  if ActiveRecord::Base.timestamped_migrations
@@ -18,12 +16,12 @@ class SandboxyGenerator < Rails::Generators::Base
18
16
  end
19
17
  end
20
18
 
21
- def create_migration_file
22
- migration_template 'migration.rb.erb', 'db/migrate/sandboxy_migration.rb', migration_version: migration_version
19
+ def create_initializer
20
+ template 'initializer.rb', 'config/initializers/sandboxy.rb'
23
21
  end
24
22
 
25
- def create_configuration
26
- template 'configuration.yml.erb', 'config/sandboxy.yml'
23
+ def create_migration_file
24
+ migration_template 'migration.rb.erb', 'db/migrate/sandboxy_migration.rb', migration_version: migration_version
27
25
  end
28
26
 
29
27
  def create_model
@@ -0,0 +1,13 @@
1
+ Sandboxy.configure do |config|
2
+
3
+ # Set your environment default: Must be either `live` or `sandbox`.
4
+ # This is the environment that your app boots with.
5
+ # By default it gets refreshed with every new request to your server.
6
+ # config.environment = 'live'
7
+
8
+ # Specify whether to retain your current app environment on new requests.
9
+ # If set to true, your app will only load your environment default when starting.
10
+ # Every additional switch of your environment at runtime will then not be automatically resolved to your environment default on a new request.
11
+ # config.retain_environment = false
12
+
13
+ end
@@ -1,44 +1,21 @@
1
1
  module Sandboxy
2
+ class Configuration
2
3
 
3
- def self.environment
4
- config = get_config
5
- if config&.key(:environment)
6
- config[:environment]
7
- else
8
- 'live'
9
- end
10
- end
11
-
12
- def self.sandbox?
13
- Sandboxy.environment == 'sandbox' ? true : false
14
- end
15
-
16
- def self.live?
17
- !Sandboxy.sandbox?
18
- end
4
+ attr_accessor :environment
5
+ attr_accessor :retain_environment
19
6
 
20
- def self.retain_environment
21
- config = get_config
22
- if config&.key(:retain_environment)
23
- config[:retain_environment]
24
- else
25
- false
7
+ def initialize
8
+ @environment = 'live'
9
+ @retain_environment = false
26
10
  end
27
- end
28
-
29
-
30
- private
31
11
 
12
+ def sandbox?
13
+ self.environment == 'sandbox' ? true : false
14
+ end
32
15
 
33
- def self.get_config
34
- require 'yaml'
35
-
36
- begin
37
- config = YAML.load_file 'config/sandboxy.yml'
38
- rescue Exception
16
+ def live?
17
+ !self.sandbox?
39
18
  end
40
19
 
41
- return config if config
42
20
  end
43
-
44
21
  end
@@ -9,9 +9,9 @@ module Sandboxy
9
9
  require 'sandboxy'
10
10
 
11
11
  previous_sandbox = $sandbox
12
- $sandbox = Sandboxy.environment == 'sandbox' ? true : false
13
-
14
- puts 'Sandbox: Moved to ' + Sandboxy.environment.to_s + ' environment' if $sandbox != previous_sandbox
12
+ $sandbox = Sandboxy.configuration.environment == 'sandbox' ? true : false
13
+
14
+ puts 'Sandbox: Moved to ' + Sandboxy.configuration.environment.to_s + ' environment' if $sandbox != previous_sandbox
15
15
  end
16
16
 
17
17
  end
@@ -12,10 +12,10 @@ module Sandboxy
12
12
 
13
13
  initializer 'sandboxy.configure_rails_initialization' do |app|
14
14
  require 'sandboxy'
15
- puts 'Sandboxy: Using ' + Sandboxy.environment.to_s + ' environment'
15
+ puts 'Sandboxy: Using ' + Sandboxy.configuration.environment + ' environment'
16
16
 
17
- $sandbox = Sandboxy.environment == 'sandbox' ? true : false
18
- app.middleware.use(Sandboxy::Middleware) unless Sandboxy.retain_environment
17
+ $sandbox = Sandboxy.configuration.environment == 'sandbox' ? true : false
18
+ app.middleware.use(Sandboxy::Middleware) unless Sandboxy.configuration.retain_environment
19
19
  end
20
20
 
21
21
  end
@@ -1,5 +1,5 @@
1
1
  module Sandboxy
2
2
 
3
- VERSION = '1.1.1'
3
+ VERSION = '2.0.0'
4
4
 
5
5
  end
data/lib/sandboxy.rb CHANGED
@@ -1,12 +1,21 @@
1
1
  require 'sandboxy/version'
2
2
 
3
-
4
3
  module Sandboxy
5
4
 
5
+ autoload :Configuration, 'sandboxy/configuration'
6
+
7
+ class << self
8
+ attr_accessor :configuration
9
+ end
10
+
11
+ def self.configure
12
+ self.configuration ||= Configuration.new
13
+ yield configuration
14
+ end
15
+
6
16
  autoload :Sandboxed, 'sandboxy/sandboxed'
7
17
 
8
- require 'sandboxy/configuration'
9
18
  require 'sandboxy/middleware'
10
- require 'sandboxy/railtie' # if defined?(Rails)
19
+ require 'sandboxy/railtie'
11
20
 
12
21
  end
data/sandboxy.gemspec CHANGED
@@ -7,9 +7,9 @@ Gem::Specification.new do |gem|
7
7
  gem.platform = Gem::Platform::RUBY
8
8
  gem.summary = 'Virtual data-oriented environments for Rails'
9
9
  gem.description = 'Sandboxy allows you to use virtual data-oriented environments inside a Rails application while being able to switch in between at runtime. It achieves that by using a combination of Rack Middleware and ActiveRecord.'
10
- gem.authors = 'Slooob'
11
- gem.email = 'developer@slooob.com'
12
- gem.homepage = 'https://developer.slooob.com/open-source'
10
+ gem.authors = 'Jonas Hübotter'
11
+ gem.email = 'jonas.huebotter@gmail.com'
12
+ gem.homepage = 'https://github.com/jonhue/sandboxy'
13
13
  gem.license = 'MIT'
14
14
 
15
15
  gem.files = `git ls-files`.split("\n")
@@ -19,12 +19,10 @@ Gem::Specification.new do |gem|
19
19
 
20
20
  gem.required_ruby_version = '>= 2.3'
21
21
 
22
- gem.add_dependency 'activerecord', '>= 4.0'
22
+ gem.add_dependency 'rails', '>= 5.0'
23
23
 
24
24
  gem.add_development_dependency 'sqlite3', '~> 1.3'
25
25
  gem.add_development_dependency 'shoulda', '~> 3.5'
26
- gem.add_development_dependency 'shoulda_create', '~> 0.0'
27
26
  gem.add_development_dependency 'factory_girl', '~> 4.8'
28
- gem.add_development_dependency 'rails', '>= 4.0'
29
27
  gem.add_development_dependency 'tzinfo-data', '~> 1.2017'
30
28
  end
@@ -0,0 +1,13 @@
1
+ Sandboxy.configure do |config|
2
+
3
+ # Set your environment default: Must be either `live` or `sandbox`.
4
+ # This is the environment that your app boots with.
5
+ # By default it gets refreshed with every new request to your server.
6
+ # config.environment = 'live'
7
+
8
+ # Specify whether to retain your current app environment on new requests.
9
+ # If set to true, your app will only load your environment default when starting.
10
+ # Every additional switch of your environment at runtime will then not be automatically resolved to your environment default on a new request.
11
+ # config.retain_environment = false
12
+
13
+ end
data/test/test_helper.rb CHANGED
@@ -16,7 +16,5 @@ load File.dirname(__FILE__) + '/schema.rb'
16
16
  require File.dirname(__FILE__) + '/../lib/generators/templates/model.rb'
17
17
 
18
18
  require 'shoulda'
19
- require 'shoulda_create'
20
19
  require 'factory_girl'
21
- ActiveSupport::TestCase.extend ShouldaCreate
22
20
  FactoryGirl.find_definitions