Sha256: ea228237032f2db4b2b8829a62122f3db15f866a43824ea82716eddea17e2c1e

Contents?: true

Size: 1.28 KB

Versions: 4

Compression:

Stored size: 1.28 KB

Contents

# Generators are not automatically loaded by Rails
require 'generators/sharing_tags/install/install_generator'

describe SharingTags::Generators::InstallGenerator, type: :generator do

  # Tell the generator where to put its output (what it thinks of as Rails.root)
  destination File.expand_path('../../tmp', __FILE__)
  teardown :cleanup_destination_root

  before do
    prepare_destination
    run_generator
  end

  describe 'initializer' do
    let(:initializer) { content_for('config/initializers/sharing_tags.rb') }
    subject { file 'config/initializers/sharing_tags.rb' }

    it "creates a sharing_tags initializer" do
      is_expected.to exist
    end

    it "generates config/initializers/sharing_tags.rb" do
      generator_command_notice = / This file was generated by the `rails generate sharing_tags:install` command./m
      is_expected.to contain(generator_command_notice)
    end

    it "expect has a valid syntax" do
      is_expected.to have_correct_syntax
    end
  end

  describe 'assets' do
    pending
    # subject { file 'app/controllers/sessions_controller.rb'}

    # it { is_expected_to have_method :index }
  end

  describe 'view' do
    pending
    # subject { file 'app/views/sessions/new.html.erb'}
    #
    # it { is_expected_to have_correct_syntax }

  end
end



Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sharing_tags-0.0.5 spec/generators/install_generator_spec.rb
sharing_tags-0.0.4 spec/generators/install_generator_spec.rb
sharing_tags-0.0.3 spec/generators/install_generator_spec.rb
sharing_tags-0.0.2 spec/generators/install_generator_spec.rb