Sha256: 8097ad18743656c3b1484135b243c1974acb10f91fea223f3669cb9a37bec5d0

Contents?: true

Size: 1.25 KB

Versions: 17

Compression:

Stored size: 1.25 KB

Contents

# Copyright:: Copyright 2009 Google Inc.
# Original Author:: John Wang (mailto:jwang392@gmail.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require File.dirname(__FILE__) + '/spec_helper.rb'
require 'appengine-apis/oauth'

describe AppEngine::OAuth do
  before :all do
    AppEngine::Testing::setup
  end

  before :each do
    @env = AppEngine::Testing::helper
    @env.set_env_consumer_key '0685bd9184jfhq22'
  end

  it "should get current user" do
    user = AppEngine::OAuth.current_user
  end

  it 'should read consumer key' do
    AppEngine::OAuth.oauth_consumer_key.should == '0685bd9184jfhq22'
  end

  it 'should read admin' do
    AppEngine::OAuth.admin?.should == false
    @env.set_env_is_admin true
    AppEngine::OAuth.admin?.should == true
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
appengine-apis-0.0.35 spec/oauth_spec.rb
appengine-apis-0.0.34 spec/oauth_spec.rb
appengine-apis-0.0.33 spec/oauth_spec.rb
appengine-apis-0.0.32 spec/oauth_spec.rb
appengine-apis-0.0.31 spec/oauth_spec.rb
appengine-apis-0.0.30 spec/oauth_spec.rb
appengine-apis-0.0.29 spec/oauth_spec.rb
appengine-apis-0.0.28 spec/oauth_spec.rb
appengine-apis-0.0.27 spec/oauth_spec.rb
appengine-apis-0.0.25 spec/oauth_spec.rb
appengine-apis-0.0.24 spec/oauth_spec.rb
appengine-apis-0.0.23 spec/oauth_spec.rb
appengine-apis-0.0.22 spec/oauth_spec.rb
appengine-apis-0.0.21 spec/oauth_spec.rb
appengine-apis-0.0.20 spec/oauth_spec.rb
appengine-apis-0.0.19 spec/oauth_spec.rb
appengine-apis-0.0.18 spec/oauth_spec.rb