Sha256: 5512ffeb4f813308b0983cfc3580f2fc2c5c8e33f2eba7ca1a5e2ad0d8a23e2b

Contents?: true

Size: 1.02 KB

Versions: 23

Compression:

Stored size: 1.02 KB

Contents

require 'generator_spec_helper'
require_generator :permits => :config

LOGFILE = 'permits-config.log'

describe 'Generator' do
  use_helpers :controller, :special, :file

  before :each do              
    setup_generator :permits_config_generator do
      tests Permits::Generators::ConfigGenerator
    end    
  end

  describe "Configure Rails 3 app for use with CanCan Permits" do
    before do    
      puts "Running generator"
      Dir.chdir Rails.root do        
        @generator = with_generator do |g|
          arguments = "--orm mongoid --logfile #{LOGFILE}".args
          g.run_generator arguments
        end
      end
    end
    
    describe 'result of permits generator' do

      it "should add the gem :cancan-permits" do
        # TODO
        Rails.root.should have_gem 'cancan-permits'
      end

      it "should generate a permits initializer file with orm set to mongoid" do      
        File.read(initializer_file(:permits)).should match /Permits::Application.orm = :mongoid/
      end      
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
cream-0.9.2 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.9.1 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.9.0 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.8.9.3 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.8.9.2 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.8.9.1 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.8.9 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.8.8 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.8.7 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.8.6 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.8.5 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.8.4 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.8.3 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.8.2 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.8.1 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.8.0 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.7.10 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.7.8 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.7.7 spec/generators/permits/config/permits_config_generator_spec.rb
cream-0.7.6 spec/generators/permits/config/permits_config_generator_spec.rb