Sha256: 490cb4c46c7ff68e74c3b3242aa1bd1fd998267d31af60d9a7f028db8a0690c9

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe "OmniAuth Namba" do
  subject do
    OmniAuth::Strategies::Namba.new(nil, { :locale => "kg" })
  end	

  it 'should add a camelization for itself' do
    OmniAuth::Utils.camelize('namba').should == 'Namba'
  end

  it 'should has correct Namba site' do
    subject.options.client_options.site.should eq("http://api.namba.#{subject.options.locale}")
  end

  it 'should has correct request token path' do
    subject.options.client_options.request_token_path.should eq("/oauth/request_token.php")
  end

  it 'should has correct access token path' do
    subject.options.client_options.access_token_path.should eq("/oauth/access_token.php")
  end

  it 'should has correct authorize url' do
    subject.options.client_options.authorize_url.should eq("http://login.namba.#{subject.options.locale}/login2.php")
  end

  it 'should not allow add locales except kg or kz' do
    expect {
      OmniAuth::Strategies::Namba.new(nil, { :locale => "za" })
    }.to raise_error(ArgumentError, "Available locales are only kg or net")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
omniauth-namba-1.0.1 spec/omniauth/strategies/namba_spec.rb
omniauth-namba-1.0.0 spec/omniauth/strategies/namba_spec.rb