Sha256: 28ca7d87e30ff3c5689b4168186b7b4f3683d4b1b726e3a40c1a385c883d2d35

Contents?: true

Size: 678 Bytes

Versions: 8

Compression:

Stored size: 678 Bytes

Contents

require 'spec_helper'

describe Redde::Generators::PhotoGenerator do
  include GeneratorSpec::TestCase
  destination File.expand_path('../../../tmp', __FILE__)

  before(:all) do
    prepare_destination
    run_generator
  end

  after(:all) do
    FileUtils.rm_rf 'tmp'
  end

  it 'Generates controller' do
    assert_file 'app/controllers/admin/photos_controller.rb'
  end

  it 'Generates views' do
    assert_directory 'app/views/admin/photos'
  end

  it 'Generates model' do
    assert_file 'app/models/photo.rb'
  end

  it 'Generates migration' do
    files = Dir['tmp/db/migrate/*.rb']
    expect(files.map(&:to_s).join(' ').index('create_photos')).to eq 30
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
redde-0.1.18 spec/generators/photo_generator_spec.rb
redde-0.1.17 spec/generators/photo_generator_spec.rb
redde-0.1.16 spec/generators/photo_generator_spec.rb
redde-0.1.15 spec/generators/photo_generator_spec.rb
redde-0.1.14 spec/generators/photo_generator_spec.rb
redde-0.1.13 spec/generators/photo_generator_spec.rb
redde-0.1.12 spec/generators/photo_generator_spec.rb
redde-0.1.11 spec/generators/photo_generator_spec.rb