forked from saturnflyer/radiant-vapor-extension
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a4d66e
commit 055314d
Showing
1 changed file
with
28 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
describe VaporFlow do | ||
describe "radiant_path" do | ||
it "should return the given path prepended with a /" do | ||
VaporFlow.radiant_path('slashy').should == '/slashy' | ||
end | ||
end | ||
describe "local_or_external_path" do | ||
it "should return the given path if it begins with 'http'" do | ||
VaporFlow.local_or_external_path('http://saturnflyer.com').should == 'http://saturnflyer.com' | ||
end | ||
it "should return the given path if it begins with 'https'" do | ||
VaporFlow.local_or_external_path('https://saturnflyer.com').should == 'https://saturnflyer.com' | ||
end | ||
it "should return the radiant_path if the given path does not begin with http" do | ||
VaporFlow.local_or_external_path('about/the/site').should == VaporFlow.radiant_path('about/the/site') | ||
end | ||
end | ||
describe "send_to_radiant" do | ||
it "should return an array" do | ||
VaporFlow.send_to_radiant.kind_of?(Array).should be_true | ||
end | ||
it "should have 404 as the first item in the array" do | ||
VaporFlow.send_to_radiant.first.should == 404 | ||
end | ||
end | ||
end |