Sha256: d419a62f155abb3abbb7f38c057c823f0db03aa0c262aa754dfda2526924a78a

Contents?: true

Size: 596 Bytes

Versions: 17

Compression:

Stored size: 596 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 target_path("views", file_path)

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

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
rspec-rails-7.1.0 lib/generators/rspec/view/view_generator.rb
rspec-rails-7.0.2 lib/generators/rspec/view/view_generator.rb
rspec-rails-7.0.1 lib/generators/rspec/view/view_generator.rb
rspec-rails-7.0.0 lib/generators/rspec/view/view_generator.rb
rspec-rails-6.1.5 lib/generators/rspec/view/view_generator.rb
rspec-rails-6.1.4 lib/generators/rspec/view/view_generator.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/rspec-rails-6.1.3/lib/generators/rspec/view/view_generator.rb
rspec-rails-6.1.3 lib/generators/rspec/view/view_generator.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/rspec-rails-6.0.4/lib/generators/rspec/view/view_generator.rb
rspec-rails-6.1.2 lib/generators/rspec/view/view_generator.rb
rspec-rails-6.1.1 lib/generators/rspec/view/view_generator.rb
rspec-rails-6.1.0 lib/generators/rspec/view/view_generator.rb
rspec-rails-6.0.4 lib/generators/rspec/view/view_generator.rb
rspec-rails-6.0.3 lib/generators/rspec/view/view_generator.rb
rspec-rails-6.0.2 lib/generators/rspec/view/view_generator.rb
rspec-rails-6.0.1 lib/generators/rspec/view/view_generator.rb
rspec-rails-6.0.0 lib/generators/rspec/view/view_generator.rb