inheritable_fixtures 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cc89a34c526032c1edfd84d12ae2466dae3e882
|
4
|
+
data.tar.gz: 7a784856afb626b8e8a530d8158699f22a6a33c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dced53ba7d393d636c97aec29199f87e2c2c3cb876dc30deb3b432a71c31d9931630d1d724b8acf94cf5fa1635af19229a2a8eb7095c70169602f6f8bf476042
|
7
|
+
data.tar.gz: d05ea42b1f1785b4bf65f7ba22276a7ff04b50fd21a0198a25cb95be0a51aa8813957dc70e81972e82943ef4f79ed92fe622cc5c5083f04c60b4e32d3acc5887
|
data/README.md
CHANGED
@@ -3,9 +3,7 @@
|
|
3
3
|
[![GitHub version](https://badge.fury.io/gh/appfolio%2Finheritable_fixtures.svg)](http://badge.fury.io/gh/appfolio%2Finheritable_fixtures)
|
4
4
|
[![Build Status](https://travis-ci.org/appfolio/inheritable_fixtures.svg?branch=master)](https://travis-ci.org/appfolio/inheritable_fixtures)
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
+
Allows Rails' engines to contain fixtures for their models and for those fixtures to be automatically used in the downstream engines. This is very much in line with Rails' engines containing db migrations for their models and for those migrations to be automatically used by the downstream engines (as described [here]( http://pivotallabs.com/leave-your-migrations-in-your-rails-engines/)).
|
9
7
|
|
10
8
|
## Installation
|
11
9
|
|
@@ -19,19 +17,23 @@ And then execute:
|
|
19
17
|
|
20
18
|
$ bundle
|
21
19
|
|
22
|
-
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
This gem introduces a configuration option called `Rails.application.config.fixtures_paths`, which is by default empty. The list of fixtures is determined by traversing all the `fixtures_paths` looking for fixture files. Note, `<rails root>/test/fixtures` is always prepended to the list and thus it has the highest precedence.
|
23
23
|
|
24
|
-
|
24
|
+
When the application initializes, each engine adds `todo` to the list (if that path exists).
|
25
25
|
|
26
|
-
|
26
|
+
### fixtures :all
|
27
27
|
|
28
|
-
|
28
|
+
Tests use `fixtures :all` or `fixtures :users, :addresses` to initial the database with necessary test data. The `fixtures` will now search for the fixtures in all `fixtures_paths` in addition to the usual `Rails.root.join('test/fixtures')`.
|
29
|
+
|
30
|
+
### fixtures\_file\_upload
|
29
31
|
|
30
|
-
|
32
|
+
The `fixture_file_upload` is a handy utility provided by Rails' for creating `Rack::Test::UploadedFile` out of a fixture file. The `fixture_file_upload` will now look for the fixture in all `fixtures_paths` in addition to the usual `Rails.root.join('test/fixtures')`.
|
31
33
|
|
32
|
-
|
34
|
+
### rake db:fixtures:load
|
33
35
|
|
34
|
-
|
36
|
+
The `db:fixtures:load` task is used to populate a database with the fixtures. This task will now load all fixtures from `fixtures_paths` in addition to the usual `Rails.root.join('test/fixtures')`.
|
35
37
|
|
36
38
|
## Contributing
|
37
39
|
|
data/lib/inheritable_fixtures.rb
CHANGED
@@ -6,7 +6,6 @@ module InheritableFixtures
|
|
6
6
|
end
|
7
7
|
|
8
8
|
require 'inheritable_fixtures/rails_extensions/engine'
|
9
|
-
require 'inheritable_fixtures/rails_extensions/engine_configuration'
|
10
9
|
require 'inheritable_fixtures/rails_extensions/test_fixtures'
|
11
10
|
require 'inheritable_fixtures/rails_extensions/test_process'
|
12
11
|
require 'inheritable_fixtures/engine'
|
@@ -30,6 +29,5 @@ module ActionDispatch
|
|
30
29
|
end
|
31
30
|
end
|
32
31
|
|
33
|
-
Rails::Engine::Configuration.prepend(::InheritableFixtures::RailsExtensions::
|
34
|
-
Rails::Engine.include(::InheritableFixtures::RailsExtensions::Engine)
|
32
|
+
Rails::Engine::Configuration.prepend(::InheritableFixtures::RailsExtensions::Engine)
|
35
33
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inheritable_fixtures
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Kmiec
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -48,7 +48,6 @@ files:
|
|
48
48
|
- lib/inheritable_fixtures/engine.rb
|
49
49
|
- lib/inheritable_fixtures/rails_extensions/db_fixtures.rake
|
50
50
|
- lib/inheritable_fixtures/rails_extensions/engine.rb
|
51
|
-
- lib/inheritable_fixtures/rails_extensions/engine_configuration.rb
|
52
51
|
- lib/inheritable_fixtures/rails_extensions/test_fixtures.rb
|
53
52
|
- lib/inheritable_fixtures/rails_extensions/test_process.rb
|
54
53
|
- lib/inheritable_fixtures/version.rb
|