Sha256: 69e6f2ae25d80a13b2ec1ff962e447a0cdf1dee4bbb713d459dbf37c78c5712d

Contents?: true

Size: 1.33 KB

Versions: 30

Compression:

Stored size: 1.33 KB

Contents

require 'spec_helper'

describe FbGraph2::TokenMetadata do
  let(:app_token) do
    attributes = mock_json 'token_metadata/app_token'
    FbGraph2::TokenMetadata.new attributes[:data]
  end
  let(:user_token) do
    attributes = mock_json 'token_metadata/user_token'
    FbGraph2::TokenMetadata.new attributes[:data]
  end
  let(:page_token) do
    attributes = mock_json 'token_metadata/page_token'
    FbGraph2::TokenMetadata.new attributes[:data]
  end
  let(:invalid_token) do
    attributes = mock_json 'token_metadata/invalid_token'
    FbGraph2::TokenMetadata.new attributes[:data]
  end

  context 'when app_token' do
    subject { app_token }
    its(:app_token?) { should == true }
    its(:user_token?) { should == false }
    its(:page_token?) { should == false }
  end

  context 'when user_token' do
    subject { user_token }
    its(:app_token?) { should == false }
    its(:user_token?) { should == true }
    its(:page_token?) { should == false }
  end

  context 'when page_token' do
    subject { page_token }
    its(:app_token?) { should == false }
    its(:user_token?) { should == false }
    its(:page_token?) { should == true }
  end

  context 'when valid' do
    subject { user_token }
    its(:valid?) { should == true }
  end

  context 'when invalid' do
    subject { invalid_token }
    its(:valid?) { should == false }
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
fb_graph2-1.3.0 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-1.2.0 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-1.1.1 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-1.1.0 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-1.0.1 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-1.0.0 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-0.9.1 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-0.9.0 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-0.8.0 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-0.7.9 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-0.7.8 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-0.7.7 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-0.7.6 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-0.7.5 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-0.7.4 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-0.7.3 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-0.7.2 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-0.7.1 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-0.7.0 spec/fb_graph2/token_metadata_spec.rb
fb_graph2-0.6.2 spec/fb_graph2/token_metadata_spec.rb