Sha256: c814542f6ebb7089a25cc39f77c9df56dfcfe0967e3c15d0c5ee026564d4a388

Contents?: true

Size: 1.19 KB

Versions: 12

Compression:

Stored size: 1.19 KB

Contents

require 'test_helper'

class InstallGeneratorTest < Rails::Generators::TestCase
  tests Maestrano::Generators::InstallGenerator
  destination File.expand_path("../../tmp", __FILE__)

  setup do
    prepare_destination
    copy_routes
  end

  should "create the maestrano initializer" do
    run_generator
    assert_file "config/initializers/maestrano.rb"
  end

  should "create the maestrano/auth/saml_controller" do
    run_generator
    assert_file "app/controllers/maestrano/auth/saml_controller.rb"
  end

  should "create the maestrano/account/groups_controller" do
    run_generator
    assert_file "app/controllers/maestrano/account/groups_controller.rb"
  end

  should "create the maestrano/account/group_users_controller" do
    run_generator
    assert_file "app/controllers/maestrano/account/group_users_controller.rb"
  end

  should "create the maestrano routes" do
    run_generator
    match = /maestrano_routes/
    assert_file "config/routes.rb", match
  end

  def copy_routes
    routes = File.expand_path("../../test_files/config/routes.rb", __FILE__)
    destination = File.join(destination_root, "config")

    FileUtils.mkdir_p(destination)
    FileUtils.cp routes, destination
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
maestrano-rails-1.0.4 test/generators/install_generator_test.rb
maestrano-rails-1.0.3 test/generators/install_generator_test.rb
maestrano-rails-1.0.2 test/generators/install_generator_test.rb
maestrano-rails-1.0.0 test/generators/install_generator_test.rb
maestrano-rails-1.0.0.pre.RC8 test/generators/install_generator_test.rb
maestrano-rails-1.0.0.pre.RC7 test/generators/install_generator_test.rb
maestrano-rails-1.0.0.pre.RC6 test/generators/install_generator_test.rb
maestrano-rails-1.0.0.pre.RC5 test/generators/install_generator_test.rb
maestrano-rails-1.0.0.pre.RC4 test/generators/install_generator_test.rb
maestrano-rails-1.0.0.pre.RC3 test/generators/install_generator_test.rb
maestrano-rails-1.0.0.pre.RC2 test/generators/install_generator_test.rb
maestrano-rails-1.0.0.pre.RC1 test/generators/install_generator_test.rb