Sha256: ea24073e65b78d589d89af37ee8d11d6a7c4277694516021be5dc1ce80f02a4e

Contents?: true

Size: 1.26 KB

Versions: 20

Compression:

Stored size: 1.26 KB

Contents

require 'test_helper'

class Shoulda::Generators::ControllerGeneratorTest < Rails::Generators::TestCase
  destination File.join(Rails.root)
  tests Rails::Generators::ControllerGenerator
  arguments %w(accounts index show new create edit update destroy --test-framework shoulda)

  setup :prepare_destination
  setup :copy_routes

  test "should invoke test framework" do
    run_generator
    assert_file "test/functional/accounts_controller_test.rb"
  end

  test "should create test class" do
    run_generator
    assert_file "test/functional/accounts_controller_test.rb" do |controller_test|
      assert_class "AccountsControllerTest", controller_test
    end
  end

  test "should create controller action tests" do
    run_generator
    assert_file "test/functional/accounts_controller_test.rb" do |controller_test|
      assert_class "AccountsControllerTest", controller_test do |klass|
        assert_match /context "index action"/, klass
        assert_match /context "show action"/, klass
        assert_match /context "new action"/, klass
        assert_match /context "create action"/, klass
        assert_match /context "edit action"/, klass
        assert_match /context "update action"/, klass
        assert_match /context "destroy action"/, klass
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rails3-generators-1.0.0 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.17.6 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.17.5 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.17.4 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.17.3 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.17.2 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.17.1 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.17.0 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.16.1 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.16.0 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.15.0 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.14.0 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.13.0 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.12.1 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.12.0 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.11.0 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.10.3 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.10.2 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.10.1 test/lib/generators/shoulda/controller_generator_test.rb
rails3-generators-0.10.0 test/lib/generators/shoulda/controller_generator_test.rb