File: access_token_spec.cr

package info (click to toggle)
crystal 1.6.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 18,956 kB
  • sloc: javascript: 1,712; sh: 592; cpp: 541; makefile: 243; ansic: 119; python: 105; 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