Sha256: 266df227a06ae7d8bc3ce3711fce1cba86dded12d84e7c2b47d4f4b02d8f42e6

Contents?: true

Size: 620 Bytes

Versions: 44

Compression:

Stored size: 620 Bytes

Contents

require 'generators/rspec'

module Rspec
  module Generators
    # @private
    class ViewGenerator < Base
      argument :actions, :type => :array, :default => [], :banner => "action action"

      class_option :template_engine, :desc => "Template engine to generate view files"

      def create_view_specs
        empty_directory File.join("spec", "views", file_path)

        actions.each do |action|
          @action = action
          template 'view_spec.rb',
                   File.join("spec", "views", file_path, "#{@action}.html.#{options[:template_engine]}_spec.rb")
        end
      end
    end
  end
end

Version data entries

44 entries across 43 versions & 5 rubygems

Version Path
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/rspec-rails-3.4.2/lib/generators/rspec/view/view_generator.rb
rspec-rails-3.5.0.beta3 lib/generators/rspec/view/view_generator.rb
rspec-rails-3.5.0.beta2 lib/generators/rspec/view/view_generator.rb
rspec-rails-3.5.0.beta1 lib/generators/rspec/view/view_generator.rb
rspec-rails-3.4.2 lib/generators/rspec/view/view_generator.rb
rspec-rails-3.4.1 lib/generators/rspec/view/view_generator.rb
rspec-rails-3.4.0 lib/generators/rspec/view/view_generator.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/rspec-rails-3.3.3/lib/generators/rspec/view/view_generator.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/rspec-rails-3.3.2/lib/generators/rspec/view/view_generator.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/rspec-rails-3.3.2/lib/generators/rspec/view/view_generator.rb
rspec-rails-3.3.3 lib/generators/rspec/view/view_generator.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/rspec-rails-3.1.0/lib/generators/rspec/view/view_generator.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/rspec-rails-3.3.2/lib/generators/rspec/view/view_generator.rb
rspec-rails-3.3.2 lib/generators/rspec/view/view_generator.rb
rspec-rails-3.3.1 lib/generators/rspec/view/view_generator.rb
rspec-rails-3.3.0 lib/generators/rspec/view/view_generator.rb
rspec-rails-3.2.3 lib/generators/rspec/view/view_generator.rb
rspec-rails-3.2.2 lib/generators/rspec/view/view_generator.rb
rspec-rails-3.2.1 lib/generators/rspec/view/view_generator.rb
rspec-rails-3.2.0 lib/generators/rspec/view/view_generator.rb