forked from refinery/refinerycms
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added spec for testing that migration for a new resource in an extens…
…ion will be numbered properly as reported in refineryGH-1885
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
core/spec/lib/generators/refinery/engine/engine_generator_multiple_resources_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
require 'spec_helper' | ||
require 'generator_spec/test_case' | ||
require 'generators/refinery/engine/engine_generator' | ||
|
||
module Refinery | ||
describe EngineGenerator do | ||
include GeneratorSpec::TestCase | ||
destination File.expand_path("../../../../../../tmp", __FILE__) | ||
|
||
before do | ||
prepare_destination | ||
run_generator %w{ rspec_product_test title:string description:text image:image brochure:resource } | ||
end | ||
|
||
context "when generating a resource inside existing extensions dir" do | ||
|
||
before do | ||
run_generator %w{ rspec_item_test title:string --extension rspec_product_tests --namespace rspec_product_tests --skip } | ||
end | ||
|
||
it "creates a new migration with the new resource" do | ||
destination_root.should have_structure { | ||
directory "vendor" do | ||
directory "extensions" do | ||
directory "rspec_product_tests" do | ||
directory "db" do | ||
directory "migrate" do | ||
file "2_create_rspec_product_tests_rspec_item_tests.rb" | ||
end | ||
end | ||
end | ||
end | ||
end | ||
} | ||
end | ||
end | ||
|
||
end | ||
end |