Class: TestUnit::Generators::OauthProviderGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/test_unit/oauth_provider_generator.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) copy_controller_test_files



11
12
13
14
# File 'lib/generators/test_unit/oauth_provider_generator.rb', line 11

def copy_controller_test_files
  template 'clients_controller_test.rb',
           File.join('test/functional', class_path, "#{file_name}_clients_controller_test.rb")
end

- (Object) copy_models_test_files



16
17
18
19
20
# File 'lib/generators/test_unit/oauth_provider_generator.rb', line 16

def copy_models_test_files
  template 'client_application_test.rb',  File.join('test/unit', 'client_application_test.rb')
  template 'oauth_token_test.rb',         File.join('test/unit', 'oauth_token_test.rb')
  template 'oauth_nonce_test.rb',         File.join('test/unit', 'oauth_nonce_test.rb')
end

- (Object) create_fixture_file



24
25
26
27
28
29
30
# File 'lib/generators/test_unit/oauth_provider_generator.rb', line 24

def create_fixture_file
  if options[:fixtures] && options[:fixture_replacement].nil?
    template 'client_applications.yml',   File.join('test/fixtures', 'client_applications.yml')
    template 'oauth_tokens.yml',          File.join('test/fixtures', 'oauth_tokens.yml')
    template 'oauth_nonces.yml',          File.join('test/fixtures', 'oauth_nonces.yml')
  end
end