Sha256: bb4b5e608f116ad27c52c180b165a5a20ebd3921299f7ad4dac3195f82dc69cb
Contents?: true
Size: 1.76 KB
Versions: 2
Compression:
Stored size: 1.76 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 end describe 'initializer' do before do run_generator end 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 describe "javascripts" do pending end describe "stylesheets" do it "expect add require styles for existing file" it "expect skip if style added " it "expect skip if file doesnot exists" end # 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 describe "after install" do it "expect has a message" do # expect { run_generator }.to output(/Congratulations/).to_stderr_from_any_process # expect { run_generator }.to output(/Congratulations/).to_stdout_from_any_process # expect { run_generator }.to output(/Congratulations/).to_stdout end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sharing_tags-0.0.7 | spec/generators/install_generator_spec.rb |
sharing_tags-0.0.6 | spec/generators/install_generator_spec.rb |