Sha256: ef10088eadf961ef9c9de4057c9d441837d8ea30e1d1a08b00a12c668fe19f48

Contents?: true

Size: 761 Bytes

Versions: 3

Compression:

Stored size: 761 Bytes

Contents

$: << File.join(File.dirname(__FILE__), %w{ .. .. })
require 'test_helper'
require 'generators/webhookr/init_generator'

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

  def setup
    @name = "test_initializer"
    @initializer = "config/initializers/#{@name}.rb"
    run_generator Array.wrap(@name)
  end

  test "it should create the initializer" do
    assert_file @initializer
  end

  test "it should have authorization information" do
    assert_file @initializer do |content|
      assert_match(%r{basic_auth\.username}, content)
      assert_match(%r{basic_auth\.password}, content)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
webhookr-0.2.0 test/integration/webhookr/init_generator_test.rb
webhookr-0.1.0 test/integration/webhookr/init_generator_test.rb
webhookr-0.0.2 test/integration/webhookr/init_generator_test.rb