Sha256: 11bf4ce838bf4a18014c888027c573eadc567f6f421df34a85a9052e3978843e

Contents?: true

Size: 1.01 KB

Versions: 19

Compression:

Stored size: 1.01 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

19 entries across 19 versions & 6 rubygems

Version Path
houston-oauth-plugin-0.5.1 lib/generators/test_unit/templates/client_application_test.rb
panjiva-oauth-plugin-0.4.1 lib/generators/test_unit/templates/client_application_test.rb
oauth-plugin-0.5.1 lib/generators/test_unit/templates/client_application_test.rb
oauth-plugin-0.5.0 lib/generators/test_unit/templates/client_application_test.rb
oauth-provider-0.5.0rc1 lib/generators/test_unit/templates/client_application_test.rb
oauth-plugin-0.4.1 lib/generators/test_unit/templates/client_application_test.rb
oauth-plugin-0.4.0 lib/generators/test_unit/templates/client_application_test.rb
oauth-plugin-0.4.0.rc2 lib/generators/test_unit/templates/client_application_test.rb
oauth-plugin-0.4.0.rc1 lib/generators/test_unit/templates/client_application_test.rb
oauth-plugin-0.4.0.pre7 lib/generators/test_unit/templates/client_application_test.rb
oauth-plugin-0.4.0.pre6 lib/generators/test_unit/templates/client_application_test.rb
oauth-plugin-0.4.0.pre5 lib/generators/test_unit/templates/client_application_test.rb
insrc-oauth-plugin-0.4.0.pre6 lib/generators/test_unit/templates/client_application_test.rb
insrc-oauth-plugin-0.4.0.pre5 lib/generators/test_unit/templates/client_application_test.rb
le1t0-oauth-plugin-0.4.0.pre4.001 lib/generators/test_unit/templates/client_application_test.rb
oauth-plugin-0.4.0.pre4 lib/generators/test_unit/templates/client_application_test.rb
oauth-plugin-0.4.0.pre3 lib/generators/test_unit/templates/client_application_test.rb
oauth-plugin-0.4.0.pre2 lib/generators/test_unit/templates/client_application_test.rb
oauth-plugin-0.4.0.pre1 lib/generators/test_unit/templates/client_application_test.rb