sandboxy 1.1.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/pull_request_template.md +2 -2
- data/CHANGELOG.md +6 -0
- data/CODE_OF_CONDUCT.md +1 -1
- data/DEPRECATIONS.md +3 -1
- data/Gemfile +1 -1
- data/INSTALL.md +1 -1
- data/LICENSE +1 -1
- data/README.md +68 -38
- data/Rakefile +0 -1
- data/examples/rails_example/Gemfile +1 -0
- data/examples/rails_example/app/api/books/api.rb +33 -0
- data/examples/rails_example/app/assets/javascripts/{bars.coffee → applications.coffee} +0 -0
- data/examples/rails_example/app/assets/javascripts/{foos.coffee → authors.coffee} +0 -0
- data/examples/rails_example/app/assets/javascripts/books.coffee +3 -0
- data/examples/rails_example/app/assets/javascripts/libraries.coffee +3 -0
- data/examples/rails_example/app/assets/javascripts/sandbox.coffee +3 -0
- data/examples/rails_example/app/assets/stylesheets/applications.scss +3 -0
- data/examples/rails_example/app/assets/stylesheets/{foos.scss → authors.scss} +1 -1
- data/examples/rails_example/app/assets/stylesheets/{bars.scss → books.scss} +1 -1
- data/examples/rails_example/app/assets/stylesheets/libraries.scss +3 -0
- data/examples/rails_example/app/assets/stylesheets/sandbox.scss +3 -0
- data/examples/rails_example/app/controllers/application_controller.rb +5 -1
- data/examples/rails_example/app/controllers/applications_controller.rb +74 -0
- data/examples/rails_example/app/controllers/authors_controller.rb +77 -0
- data/examples/rails_example/app/controllers/books_controller.rb +77 -0
- data/examples/rails_example/app/controllers/libraries_controller.rb +77 -0
- data/examples/rails_example/app/controllers/sandbox_controller.rb +6 -0
- data/examples/rails_example/app/helpers/applications_helper.rb +2 -0
- data/examples/rails_example/app/helpers/authors_helper.rb +2 -0
- data/examples/rails_example/app/helpers/books_helper.rb +2 -0
- data/examples/rails_example/app/helpers/libraries_helper.rb +2 -0
- data/examples/rails_example/app/helpers/sandbox_helper.rb +2 -0
- data/examples/rails_example/app/models/application.rb +14 -0
- data/examples/rails_example/app/models/author.rb +2 -0
- data/examples/rails_example/app/models/book.rb +2 -0
- data/examples/rails_example/app/models/library.rb +2 -0
- data/examples/rails_example/app/views/applications/_application.json.jbuilder +2 -0
- data/examples/rails_example/app/views/applications/_form.html.erb +19 -0
- data/examples/rails_example/app/views/applications/edit.html.erb +6 -0
- data/examples/rails_example/app/views/applications/index.html.erb +25 -0
- data/examples/rails_example/app/views/applications/index.json.jbuilder +1 -0
- data/examples/rails_example/app/views/applications/new.html.erb +5 -0
- data/examples/rails_example/app/views/applications/show.html.erb +7 -0
- data/examples/rails_example/app/views/applications/show.json.jbuilder +1 -0
- data/examples/rails_example/app/views/authors/_author.json.jbuilder +2 -0
- data/examples/rails_example/app/views/authors/_form.html.erb +19 -0
- data/examples/rails_example/app/views/authors/edit.html.erb +6 -0
- data/examples/rails_example/app/views/authors/index.html.erb +25 -0
- data/examples/rails_example/app/views/authors/index.json.jbuilder +1 -0
- data/examples/rails_example/app/views/authors/new.html.erb +5 -0
- data/examples/rails_example/app/views/authors/show.html.erb +4 -0
- data/examples/rails_example/app/views/authors/show.json.jbuilder +1 -0
- data/examples/rails_example/app/views/books/_book.json.jbuilder +2 -0
- data/examples/rails_example/app/views/books/_form.html.erb +19 -0
- data/examples/rails_example/app/views/books/edit.html.erb +6 -0
- data/examples/rails_example/app/views/books/index.html.erb +25 -0
- data/examples/rails_example/app/views/books/index.json.jbuilder +1 -0
- data/examples/rails_example/app/views/books/new.html.erb +5 -0
- data/examples/rails_example/app/views/books/show.html.erb +4 -0
- data/examples/rails_example/app/views/books/show.json.jbuilder +1 -0
- data/examples/rails_example/app/views/libraries/_form.html.erb +19 -0
- data/examples/rails_example/app/views/libraries/_library.json.jbuilder +2 -0
- data/examples/rails_example/app/views/libraries/edit.html.erb +6 -0
- data/examples/rails_example/app/views/libraries/index.html.erb +25 -0
- data/examples/rails_example/app/views/libraries/index.json.jbuilder +1 -0
- data/examples/rails_example/app/views/libraries/new.html.erb +5 -0
- data/examples/rails_example/app/views/libraries/show.html.erb +4 -0
- data/examples/rails_example/app/views/libraries/show.json.jbuilder +1 -0
- data/examples/rails_example/config/initializers/grape.rb +2 -0
- data/examples/rails_example/config/initializers/sandboxy.rb +13 -0
- data/examples/rails_example/config/routes.rb +9 -3
- data/examples/rails_example/config/secrets.yml +2 -2
- data/examples/rails_example/db/migrate/20170827184048_create_books.rb +9 -0
- data/examples/rails_example/db/migrate/20170827184054_create_authors.rb +9 -0
- data/examples/rails_example/db/migrate/20170827184106_create_libraries.rb +9 -0
- data/examples/rails_example/db/migrate/20170827184304_create_applications.rb +11 -0
- data/examples/rails_example/db/migrate/{20170827105828_sandboxy_migration.rb → 20170827190815_sandboxy_migration.rb} +0 -0
- data/examples/rails_example/db/schema.rb +19 -3
- data/examples/rails_example/test/controllers/applications_controller_test.rb +48 -0
- data/examples/rails_example/test/controllers/authors_controller_test.rb +48 -0
- data/examples/rails_example/test/controllers/books_controller_test.rb +48 -0
- data/examples/rails_example/test/controllers/libraries_controller_test.rb +48 -0
- data/examples/rails_example/test/controllers/sandbox_controller_test.rb +7 -0
- data/examples/rails_example/test/fixtures/{bars.yml → applications.yml} +0 -0
- data/examples/rails_example/test/fixtures/{foos.yml → authors.yml} +0 -0
- data/examples/rails_example/test/fixtures/books.yml +11 -0
- data/examples/rails_example/test/fixtures/libraries.yml +11 -0
- data/examples/rails_example/test/models/application_test.rb +7 -0
- data/examples/rails_example/test/models/{bar_test.rb → author_test.rb} +1 -1
- data/examples/rails_example/test/models/{foo_test.rb → book_test.rb} +1 -1
- data/examples/rails_example/test/models/library_test.rb +7 -0
- data/examples/rails_example/test/system/applications_test.rb +9 -0
- data/examples/rails_example/test/system/authors_test.rb +9 -0
- data/examples/rails_example/test/system/books_test.rb +9 -0
- data/examples/rails_example/test/system/libraries_test.rb +9 -0
- data/lib/generators/sandboxy_generator.rb +4 -6
- data/lib/generators/templates/initializer.rb +13 -0
- data/lib/sandboxy/configuration.rb +11 -34
- data/lib/sandboxy/middleware.rb +3 -3
- data/lib/sandboxy/railtie.rb +3 -3
- data/lib/sandboxy/version.rb +1 -1
- data/lib/sandboxy.rb +12 -3
- data/sandboxy.gemspec +4 -6
- data/test/dummy30/config/initializers/sandboxy.rb +13 -0
- data/test/test_helper.rb +0 -2
- metadata +93 -78
- data/examples/rails_example/app/controllers/bars_controller.rb +0 -74
- data/examples/rails_example/app/controllers/foos_controller.rb +0 -74
- data/examples/rails_example/app/helpers/bars_helper.rb +0 -2
- data/examples/rails_example/app/helpers/foos_helper.rb +0 -2
- data/examples/rails_example/app/models/bar.rb +0 -2
- data/examples/rails_example/app/models/foo.rb +0 -2
- data/examples/rails_example/app/models/shared_sandbox.rb +0 -3
- data/examples/rails_example/app/views/bars/_bar.json.jbuilder +0 -2
- data/examples/rails_example/app/views/bars/_form.html.erb +0 -17
- data/examples/rails_example/app/views/bars/edit.html.erb +0 -6
- data/examples/rails_example/app/views/bars/index.html.erb +0 -25
- data/examples/rails_example/app/views/bars/index.json.jbuilder +0 -1
- data/examples/rails_example/app/views/bars/new.html.erb +0 -5
- data/examples/rails_example/app/views/bars/show.html.erb +0 -4
- data/examples/rails_example/app/views/bars/show.json.jbuilder +0 -1
- data/examples/rails_example/app/views/foos/_foo.json.jbuilder +0 -2
- data/examples/rails_example/app/views/foos/_form.html.erb +0 -17
- data/examples/rails_example/app/views/foos/edit.html.erb +0 -6
- data/examples/rails_example/app/views/foos/index.html.erb +0 -25
- data/examples/rails_example/app/views/foos/index.json.jbuilder +0 -1
- data/examples/rails_example/app/views/foos/new.html.erb +0 -5
- data/examples/rails_example/app/views/foos/show.html.erb +0 -4
- data/examples/rails_example/app/views/foos/show.json.jbuilder +0 -1
- data/examples/rails_example/config/sandboxy.yml +0 -13
- data/examples/rails_example/db/migrate/20170826223227_create_foos.rb +0 -8
- data/examples/rails_example/db/migrate/20170826223243_create_bars.rb +0 -8
- data/examples/rails_example/test/controllers/bars_controller_test.rb +0 -48
- data/examples/rails_example/test/controllers/foos_controller_test.rb +0 -48
- data/examples/rails_example/test/system/bars_test.rb +0 -9
- data/examples/rails_example/test/system/foos_test.rb +0 -9
- 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
|
File without changes
|
File without changes
|
@@ -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
|
@@ -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
|
22
|
-
|
19
|
+
def create_initializer
|
20
|
+
template 'initializer.rb', 'config/initializers/sandboxy.rb'
|
23
21
|
end
|
24
22
|
|
25
|
-
def
|
26
|
-
|
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
|
-
|
4
|
-
|
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
|
-
|
21
|
-
|
22
|
-
|
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
|
-
|
34
|
-
|
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
|
data/lib/sandboxy/middleware.rb
CHANGED
@@ -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
|
data/lib/sandboxy/railtie.rb
CHANGED
@@ -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
|
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
|
data/lib/sandboxy/version.rb
CHANGED
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'
|
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 = '
|
11
|
-
gem.email = '
|
12
|
-
gem.homepage = 'https://
|
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 '
|
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
|