Class: Rspec::Generators::OauthProviderGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/rspec/oauth_provider_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_controller_spec_filesObject



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

def copy_controller_spec_files
  template 'clients_controller_spec.rb',
    File.join('spec/controllers', class_path, "#{file_name}_clients_controller_spec.rb")
end

#copy_models_spec_filesObject



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

def copy_models_spec_files
  template 'client_application_spec.rb',  File.join('spec/models', 'client_application_spec.rb')
  template 'oauth_token_spec.rb',         File.join('spec/models', 'oauth_token_spec.rb')
  template 'oauth2_token_spec.rb',        File.join('spec/models', 'oauth2_token_spec.rb')
  template 'oauth2_verifier_spec.rb',     File.join('spec/models', 'oauth2_verifier_spec.rb')
  template 'oauth_nonce_spec.rb',         File.join('spec/models', 'oauth_nonce_spec.rb')
end

#create_fixture_fileObject



26
27
28
29
30
31
32
# File 'lib/generators/rspec/oauth_provider_generator.rb', line 26

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