Sha256: 0095b423ca5f2e84978d76862e0bba24900b18b6590c8342e162eeab822868cc

Contents?: true

Size: 1.59 KB

Versions: 1

Compression:

Stored size: 1.59 KB

Contents

require 'generators/rspec/integration/integration_generator'
require File.join(File.dirname(__FILE__), '../../active_leonardo')

module Rspec
  module Generators
    class LeointegrationGenerator < ::Rspec::Generators::IntegrationGenerator
      include ::ActiveLeonardo::Base
      include ::ActiveLeonardo::Leosca
      include ::ActiveLeonardo::Test
      #include ::ActiveLeonardo::Nested
      #include ::ActiveLeonardo::Nested::Test

      #puts 'Rspec:Generators:LeointegrationGenerator'
      source_paths << File.expand_path('../templates', __FILE__)

      argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"

      class_option :remote, :type => :boolean, :default => true, :desc => "It checks ajax sections"
      class_option :under, :type => :string, :default => "", :banner => "brand/category", :desc => "Nested resources"
      class_option :activespace, :type => :string, :default => "admin", :banner => ":admin", :desc => "To nest a resource under namespace(s)"

      def generate_request_spec
        return unless options[:request_specs]

        template 'feature.rb',
                  #File.join('spec/requests', class_path, base_namespaces, "#{table_name}_spec.rb")
                  File.join('spec/features', class_path, "#{table_name}.rb")
        template "#{options[:activespace]}/feature.rb",
                 #File.join('spec/requests', class_path, base_namespaces, "#{table_name}_spec.rb")
                 File.join('spec/features', options[:activespace], class_path, "#{table_name}.rb")
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_leonardo-0.2.0 lib/generators/rspec/leointegration/leointegration_generator.rb