Sha256: cc1746e95b3dcff6232d35d909eeab33285b3e920fe859cbedeee2a9bbc30549

Contents?: true

Size: 981 Bytes

Versions: 23

Compression:

Stored size: 981 Bytes

Contents

require 'spec_helper'
require 'generators/rspec/enquiry_controller/enquiry_controller_generator'

describe Rspec::Generators::EnquiryControllerGenerator, :type => :generator do
  it "should run all tasks in the generator" do
    gen = generator %w(foo_bar)
    expect(gen).to receive(:create_enquiry_controller_spec)
    capture(:stdout) { gen.invoke_all }
  end

  describe "the generated files" do
    describe "the spec" do
      describe "with defaults" do
        before do
          run_generator %w(foo_bar)
        end

        subject { file('spec/controllers/foo_bar_enquiry_controller_spec.rb') }

        it { should exist }
      end

      describe "with action names" do
        before do
          run_generator %w(foo_bar baz)
        end

        subject { file('spec/controllers/foo_bar_enquiry_controller_spec.rb') }

        it { should exist }
        it { should contain("GET 'baz'") }
        it { should contain("POST 'baz'") }
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
riveter-0.8.3 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.8.2 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.8.1 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.8.0 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.7.0 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.6.0 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.3.0 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.2.1 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.2.0 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.1.1 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.0.15 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.0.14 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.0.13 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.0.12 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.0.11 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.0.10 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.0.9 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.0.8 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.0.7 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb
riveter-0.0.6 spec/generators/rspec/enquiry_controller/enquiry_controller_generator_spec.rb