Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adds feature coverage for FIXTURES with restrict by TABLES option. An…

…d fixes it.
  • Loading branch information...
commit d43f5e82c7d141bb68792b6aaefed01db5b18d0a 1 parent f3bb3ac
@ianwhite authored
Showing with 21 additions and 4 deletions.
  1. +20 −3 features/load/load_fixtures.feature
  2. +1 −1  lib/git_friendly_dumper.rb
View
23 features/load/load_fixtures.feature
@@ -97,10 +97,27 @@ Feature: Load fixtures
Scenario: TABLES can be used whitelist a subset of the FIXTURES to operate on
- Given an empty database
- And some User fixtures
- And some Notes fixtures
+ Given the database has a "notes" table:
+ | body (string) |
+ | Get milk |
+ | Buy Meat |
+ And a file named "db/dump/notes/0000/0001.yml" with:
+ """
+ ---
+ body: Get cheese
+ id: 1
+ """
+ When I successfully run "rake db:data:load TABLES=notes FIXTURES=notes/0000/0001.yml,users/0000/0001.yml,users/0000/0003.yml,users/0000/0011.yml FORCE=true"
+ Then the "notes" table should match exactly:
+ | id | body |
+ | 1 | Get cheese |
+ | 2 | Buy Meat |
+ And the "users" table should match exactly:
+ | id | name | surname |
+ | 1 | Fred | Bloggs |
+ | 2 | Ethel | Smith |
+ | 3 | Jane | Heidie |
View
2  lib/git_friendly_dumper.rb
@@ -31,7 +31,6 @@ def initialize(options = {})
self.root = options[:root] || (defined?(Rails) && Rails.root) || pwd
if options[:fixtures] && (options[:include_schema] || options[:clobber_fixtures])
- puts options.to_yaml
raise ArgumentError, "GitFriendlyDumper if :fixtures option given, neither :include_schema nor :clobber_fixtures can be given"
end
@@ -131,6 +130,7 @@ def load_fixtures
fixture
end
end
+ fixtures.compact!
self.tables = fixtures_tables
Please sign in to comment.
Something went wrong with that request. Please try again.