Sha256: 5996509f2ca755a5dded68475b551c7f4a711eae97a98195bda31ef514d19af5

Contents?: true

Size: 744 Bytes

Versions: 6

Compression:

Stored size: 744 Bytes

Contents

require "test_helper"
require "generators/roomer/setup/setup_generator"

class SetupGeneratorTest < Rails::Generators::TestCase
  tests Roomer::Generators::SetupGenerator
  destination File.expand_path("../../tmp", __FILE__)
  setup :prepare_destination

  test "assert roomer method exists in tenant model" do
    run_generator
    assert_file "app/models/tenant.rb" do |model|
      assert_match /roomer :shared/, model
    end
  end

  test "assert migration file exist and contains necessary attributes" do
    run_generator
    assert_migration "db/migrate/global/roomer_create_tenants.rb" do |migration|
      assert_match /t.string :url_identifier/, migration
      assert_match /t.string :schema_name/,    migration
    end
  end


end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
roomer-1.0.1 test/generators/setup_generator_test.rb
roomer-1.0.0 test/generators/setup_generator_test.rb
roomer-0.0.11 test/generators/setup_generator_test.rb
roomer-0.0.10 test/generators/setup_generator_test.rb
roomer-0.0.9 test/generators/setup_generator_test.rb
roomer-0.0.8 test/generators/setup_generator_test.rb