Sha256: bb9045e2f414a5778a23e04f14aaaa79b9261fdae109313f141824b8595ac9da

Contents?: true

Size: 1.32 KB

Versions: 24

Compression:

Stored size: 1.32 KB

Contents

require 'generator_spec_helper'
require_generator :devise => :config

LOGFILE = 'devise-config.log'

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

  before do              
    setup_generator :devise_config_generator do
      tests Devise::Generators::ConfigGenerator
    end    
  end

  describe "Configure Rails 3 app for use with Devise" do

    before do
      orm = :mongoid
      
      Dir.chdir Rails.root do        
        @generator = with_generator do |g|
          arguments = "--orm #{orm} --logfile #{LOGFILE}".args 
          g.run_generator arguments
        end
      end
    end

    describe 'result of Devise config generator' do
      it "should add devise gems" do
        Rails.root.should have_gem 'devise'
      end

      it "should add Devise before_filter to ApplicationController" do
        Rails.root.should have_controller :application do |app_controller|  
          app_controller.should match /before_filter :authenticate_user!/
        end
      end

      it "should add orm setting to devise initializer" do
        File.read(initializer_file(:devise)).should match /devise\/orm\/mongoid/
      end

      it "should add devise mailer setting to Applicaiton config" do
        File.read(application_file).should match /action_mailer.default_url_options/
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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