File: access_token_spec.cr

package info (click to toggle)
crystal 1.14.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 24,384 kB
  • sloc: javascript: 6,400; sh: 695; makefile: 269; ansic: 121; python: 105; cpp: 77; xml: 32
file content (12 lines) | stat: -rw-r--r-- 513 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
require "spec"
require "oauth"

describe OAuth::AccessToken do
  it "creates from response body" do
    access_token = OAuth::AccessToken.from_response("oauth_token=1234-nyi1G37179bVdYNZGZqKQEdO&oauth_token_secret=f7T6ibH25q4qkVTAUN&user_id=1234&screen_name=someuser")
    access_token.token.should eq("1234-nyi1G37179bVdYNZGZqKQEdO")
    access_token.secret.should eq("f7T6ibH25q4qkVTAUN")
    access_token.extra["user_id"].should eq("1234")
    access_token.extra["screen_name"].should eq("someuser")
  end
end