Sha256: 2543d47d87a4034858c775bf64a1c8e7a169a0bf919be3b8c809d3b9161fd884

Contents?: true

Size: 984 Bytes

Versions: 24

Compression:

Stored size: 984 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

describe TwitterAuth::Dispatcher::Shared do
  include TwitterAuth::Dispatcher::Shared

  describe '#append_extension_to' do
    it 'should leave extensions alone if they exist' do
      append_extension_to('/fake.json').should == '/fake.json'    
      append_extension_to('/fake.xml').should == '/fake.xml'
    end

    it 'should append .json if no extension is provided' do
      append_extension_to('/fake').should == '/fake.json'
      append_extension_to('/verify/fake').should == '/verify/fake.json'
    end

    it 'should leave extensions alone even with query strings' do
      append_extension_to('/fake.json?since_id=123').should == '/fake.json?since_id=123'
      append_extension_to('/fake.xml?since_id=123').should == '/fake.xml?since_id=123'
    end

    it 'should add an extension even with query strings' do
      append_extension_to('/fake?since_id=123').should == '/fake.json?since_id=123'
    end
  end
end

Version data entries

24 entries across 24 versions & 6 rubygems

Version Path
mbleigh-twitter-auth-0.1.12 spec/twitter_auth/dispatcher/shared_spec.rb
mbleigh-twitter-auth-0.1.13 spec/twitter_auth/dispatcher/shared_spec.rb
mbleigh-twitter-auth-0.1.14 spec/twitter_auth/dispatcher/shared_spec.rb
mbleigh-twitter-auth-0.1.15 spec/twitter_auth/dispatcher/shared_spec.rb
mbleigh-twitter-auth-0.1.16 spec/twitter_auth/dispatcher/shared_spec.rb
mbleigh-twitter-auth-0.1.18 spec/twitter_auth/dispatcher/shared_spec.rb
mbleigh-twitter-auth-0.1.20 spec/twitter_auth/dispatcher/shared_spec.rb
mbleigh-twitter-auth-0.1.21 spec/twitter_auth/dispatcher/shared_spec.rb
mbleigh-twitter-auth-0.1.22 spec/twitter_auth/dispatcher/shared_spec.rb
millsb-twitter-auth-0.1.16 spec/twitter_auth/dispatcher/shared_spec.rb
xaviershay-twitter-auth-0.1.19 spec/twitter_auth/dispatcher/shared_spec.rb
twitter-auth-with-mongo-mapper-0.1.1 spec/twitter_auth/dispatcher/shared_spec.rb
twitter-auth-with-mongo-mapper-0.1.0 spec/twitter_auth/dispatcher/shared_spec.rb
twitter-auth-with-mongo-mapper-0.0.9 spec/twitter_auth/dispatcher/shared_spec.rb
stocktwits-1.0.0 spec/stocktwits/dispatcher/shared_spec.rb
twitter-auth-0.1.22 spec/twitter_auth/dispatcher/shared_spec.rb
twitter-auth-0.1.12 spec/twitter_auth/dispatcher/shared_spec.rb
twitter-auth-0.1.13 spec/twitter_auth/dispatcher/shared_spec.rb
twitter-auth-0.1.16 spec/twitter_auth/dispatcher/shared_spec.rb
twitter-auth-0.1.14 spec/twitter_auth/dispatcher/shared_spec.rb