Sha256: f5c00b4615b0648202397c5497f4bd53370f668deefbb2e2417a59be951e82b6

Contents?: true

Size: 898 Bytes

Versions: 1

Compression:

Stored size: 898 Bytes

Contents

require 'helper'
require 'rails/generators'
require 'generators/presenter/presenter_generator'

class PresenterGeneratorTest < Rails::Generators::TestCase
  tests PresenterGenerator
  destination File.expand_path("../tmp", File.dirname(__FILE__))
  setup :prepare_destination

  test "create presenter" do
    run_generator %w(test)
    
    assert_file "app/presenters/test_presenter.rb" do |presenter|
      assert_match(/class TestPresenter < Presenter/, presenter)
      assert_match(/def initialize\(test\)/, presenter)
      assert_match(/@test = test/, presenter)
    end

  end

  test "create presenter test" do 
    run_generator %w(test)
    
    assert_file "test/presenters/test_presenter_test.rb" do |presenter_test|
      assert_match(/#require 'test_helper'/, presenter_test)
      assert_match(/class TestPresenterTest < ActiveSupport::TestCase/, presenter_test)
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
neo-rails-0.2.1 test/generator/presenter_generator_test.rb