Sha256: 53f08b8ff7d9024c485159411ce63bba44bbcd3bf38aad25d4eda4f578567de5

Contents?: true

Size: 1.02 KB

Versions: 28

Compression:

Stored size: 1.02 KB

Contents

require File.dirname(__FILE__) + '/../test_helper'
module OAuthHelpers
  
  def create_consumer
    @consumer=OAuth::Consumer.new(@application.key,@application.secret,
      {
        :site=>@application.oauth_server.base_url
      })
  end
  
end

class ClientApplicationTest < ActiveSupport::TestCase
  include OAuthHelpers
  fixtures :users,:client_applications,:oauth_tokens
  
  def setup
    @application = ClientApplication.create :name=>"Agree2",:url=>"http://agree2.com",:user=>users(:quentin)
    create_consumer
  end

  def test_should_be_valid
    assert @application.valid?
  end
  
    
  def test_should_not_have_errors
    assert_equal [], @application.errors.full_messages
  end
  
  def test_should_have_key_and_secret
    assert_not_nil @application.key
    assert_not_nil @application.secret
  end

  def test_should_have_credentials
    assert_not_nil @application.credentials
    assert_equal @application.key, @application.credentials.key
    assert_equal @application.secret, @application.credentials.secret
  end
  
end

Version data entries

28 entries across 28 versions & 5 rubygems

Version Path
filiptepper-oauth-plugin-0.3.11 generators/oauth_provider/templates/client_application_test.rb
pelle-oauth-plugin-0.3.10 generators/oauth_provider/templates/client_application_test.rb
pelle-oauth-plugin-0.3.11 generators/oauth_provider/templates/client_application_test.rb
pelle-oauth-plugin-0.3.5 generators/oauth_provider/templates/client_application_test.rb
pelle-oauth-plugin-0.3.6 generators/oauth_provider/templates/client_application_test.rb
pelle-oauth-plugin-0.3.7 generators/oauth_provider/templates/client_application_test.rb
pelle-oauth-plugin-0.3.8 generators/oauth_provider/templates/client_application_test.rb
pelle-oauth-plugin-0.3.9 generators/oauth_provider/templates/client_application_test.rb
oauth-plugin-0.4.0.pre5 generators/oauth_provider/templates/client_application_test.rb
insrc-oauth-plugin-0.4.0.pre6 generators/oauth_provider/templates/client_application_test.rb
insrc-oauth-plugin-0.4.0.pre5 generators/oauth_provider/templates/client_application_test.rb
le1t0-oauth-plugin-0.3.14.001 generators/oauth_provider/templates/client_application_test.rb
le1t0-oauth-plugin-0.4.0.pre4.001 generators/oauth_provider/templates/client_application_test.rb
oauth-plugin-0.4.0.pre4 generators/oauth_provider/templates/client_application_test.rb
oauth-plugin-0.4.0.pre3 generators/oauth_provider/templates/client_application_test.rb
oauth-plugin-0.4.0.pre2 generators/oauth_provider/templates/client_application_test.rb
oauth-plugin-0.4.0.pre1 generators/oauth_provider/templates/client_application_test.rb
oauth-plugin-0.3.14 generators/oauth_provider/templates/client_application_test.rb
oauth-plugin-0.3.13 generators/oauth_provider/templates/client_application_test.rb
oauth-plugin-0.3.12 generators/oauth_provider/templates/client_application_test.rb