File: test_access_token.rb

package info (click to toggle)
ruby-oauth 0.5.4-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 584 kB
  • sloc: ruby: 4,070; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 744 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require File.expand_path('../../test_helper', __FILE__)

class TestAccessToken < Minitest::Test
  def setup
    @fake_response = {
      :user_id => 5734758743895,
      :oauth_token => "key",
      :oauth_token_secret => "secret"
    }
    # setup a fake req. token. mocking Consumer would be more appropriate...
    @access_token = OAuth::AccessToken.from_hash(
      OAuth::Consumer.new("key", "secret", {}),
      @fake_response
    )
  end

  def test_provides_response_parameters
    assert @access_token
    assert_respond_to @access_token, :params
  end

  def test_access_token_makes_non_oauth_response_params_available
    assert @access_token.params[:user_id]
    assert_equal 5734758743895, @access_token.params[:user_id]
  end
end