Sha256: af16409389e582ff94f073716e684ba3376bdea49ecd55247dfecd916b5a4752

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

describe Chili::GeneratorProxy do
  let(:app) { DummyApp.new }

  before do
    app.setup!
    puts `cd #{app.path} && rails g chili:feature blank`
  end


  context 'running generator from a newly created feature' do
    it "generates resources properly" do
      puts `cd #{app.path} && rails g blank_feature scaffold post`
      File.exist?(File.join(app.path, 'lib/chili/blank_feature/app/controllers/blank_feature/posts_controller.rb')).should be_true
      File.exist?(File.join(app.path, 'lib/chili/blank_feature/app/assets/stylesheets/blank_feature/posts.css')).should be_true
    end
  end

  context 'passing in options' do
    it "passes options on to rails generator" do
      puts `cd #{app.path} && rails g blank_feature scaffold post --stylesheets=false`
      File.exist?(File.join(app.path, 'lib/chili/blank_feature/app/controllers/blank_feature/posts_controller.rb')).should be_true
      File.exist?(File.join(app.path, 'lib/chili/blank_feature/app/assets/stylesheets/blank_feature/posts.css')).should be_false
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
chili-3.0.0 spec/generators/chili/generator_proxy_spec.rb
chili-2.0.1 spec/generators/chili/generator_proxy_spec.rb
chili-2.0.0 spec/generators/chili/generator_proxy_spec.rb