Skip to content

Commit

Permalink
Added spec for testing that migration for a new resource in an extens…
Browse files Browse the repository at this point in the history
…ion will be numbered properly as reported in refineryGH-1885
  • Loading branch information
brenes committed Aug 17, 2012
1 parent 70516f2 commit 19de862
Showing 1 changed file with 39 additions and 0 deletions.
@@ -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

0 comments on commit 19de862

Please sign in to comment.