Sha256: 81fc0bcf27b94735dd655de9cb11d04fcbf1a09b44f271492c51cf4df3729ad5

Contents?: true

Size: 667 Bytes

Versions: 1

Compression:

Stored size: 667 Bytes

Contents

require "spec_helper"
require "generators/scenic/model/model_generator"

describe Scenic::Generators::ModelGenerator, :generator do
  before do
    allow(Scenic::Generators::ViewGenerator).to receive(:new)
      .and_return(
        instance_double("Scenic::Generators::ViewGenerator").as_null_object
      )
  end

  it "invokes the view generator" do
    run_generator ["current_customer"]

    expect(Scenic::Generators::ViewGenerator).to have_received(:new)
  end

  it "creates a migration to create the view" do
    run_generator ["current_customer"]
    model_definition = file("app/models/current_customer.rb")
    expect(model_definition).to exist
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scenic-0.1.0 spec/generators/scenic/model/model_generator_spec.rb