Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dispatchers now correctly handle query strings. [#7 status:resolved]
- Loading branch information
Michael Bleigh
committed
Mar 27, 2009
1 parent
708a665
commit 80dd01e
Showing
4 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
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 |