Permalink
Browse files

Version 0.4.1 (exported from SVN)

  • Loading branch information...
1 parent 6d2491f commit 371c37bb12e83648fb510960321592d31fc79d41 @chrisparrish chrisparrish committed Oct 18, 2008
View
@@ -1,6 +1,12 @@
+v0.4.1 Bug fix. Last-Modified header was not reporting the date using a valid
+ HTTP format. This is now spec'ed and fixed. (Thanks to Jay Levitt for
+ identifying this issue).
+
+
v0.4 File Uploading! You can now upload Javascripts or Stylesheets from the
corresponding index pages.
+
v0.3.1 Moved Templates to Haml -- now requires Radiant 0.6.7 (or 0.6.6 and
install Haml yourself -- untested).
@@ -39,7 +39,7 @@ def show_uncached_text_asset(filename, asset_class, url)
response.headers['Content-Type'] = mime_type
# set the last modified date based on updated_at time for the asset
# we can do this as long as there is no dynamic content in the assets
- response.headers['Last-Modified'] = @text_asset.effectively_updated_at
+ response.headers['Last-Modified'] = @text_asset.effectively_updated_at.httpdate
response.body = @text_asset.render
# for text_assets, we cache no matter what (no 'status' setting for them)
@@ -218,12 +218,30 @@
end
+ it "should be a string" do
+ get :show_text_asset,
+ :filename => ['dependant'],
+ :directory => current_asset[:default_directory],
+ :asset_type => current_asset[:name]
+ response.headers['Last-Modified'].should be_kind_of(String)
+ end
+
+
+ it "should use a valid HTTP header date format" do
+ get :show_text_asset,
+ :filename => ['dependant'],
+ :directory => current_asset[:default_directory],
+ :asset_type => current_asset[:name]
+ response.headers['Last-Modified'].should == "Mon, 01 Jan 1990 00:00:00 GMT"
+ end
+
+
it "should reflect the #{current_asset[:name]}'s updated_at date/time if the file has no dependencies" do
get :show_text_asset,
:filename => ['dependant'],
:directory => current_asset[:default_directory],
:asset_type => current_asset[:name]
- response.headers['Last-Modified'].should == Time.local(1990)
+ response.headers['Last-Modified'].should == Time.gm(1990).httpdate
end
@@ -236,7 +254,7 @@
:filename => ['dependant'],
:directory => current_asset[:default_directory],
:asset_type => current_asset[:name]
- response.headers['Last-Modified'].should == Time.local(1992)
+ response.headers['Last-Modified'].should == Time.gm(1992).httpdate
end
@@ -249,7 +267,7 @@
:filename => ['dependant'],
:directory => current_asset[:default_directory],
:asset_type => current_asset[:name]
- response.headers['Last-Modified'].should == Time.local(1994)
+ response.headers['Last-Modified'].should == Time.gm(1994).httpdate
end
end
@@ -264,6 +282,6 @@
private
def save_asset_at(text_asset, year)
- Time.stub!(:now).and_return(Time.local(year))
+ Time.stub!(:now).and_return(Time.gm(year))
text_asset.save!
end
@@ -73,20 +73,20 @@
it "should reflect its own creation date/time (created_at) if the file hasn't been updated and has no dependencies" do
- @dependant.dependencies.effectively_updated_at.should == Time.local(1990)
+ @dependant.dependencies.effectively_updated_at.should == Time.gm(1990)
end
it "should reflect its own change date/time (updated_at) if the file has no dependencies" do
save_asset_at(@dependant, 1994)
- @dependant.dependencies.effectively_updated_at.should == Time.local(1994)
+ @dependant.dependencies.effectively_updated_at.should == Time.gm(1994)
end
it "should reflect its own change date/time if it references dependencies which do not exist" do
@dependant.content = %{<r:#{current_tag[:name]}name="a_bogus_text_asset" />}
save_asset_at(@dependant, 1994)
- @dependant.dependencies.effectively_updated_at.should == Time.local(1994)
+ @dependant.dependencies.effectively_updated_at.should == Time.gm(1994)
end
@@ -98,7 +98,7 @@
save_asset_at(@dependency, 1995)
@dependant = current_tag[:class].find_by_filename('dependant')
- @dependant.dependencies.effectively_updated_at.should == Time.local(1995)
+ @dependant.dependencies.effectively_updated_at.should == Time.gm(1995)
end
@@ -112,7 +112,7 @@
save_asset_at(@dependant, 1999)
@dependant = current_tag[:class].find_by_filename('dependant')
- @dependant.dependencies.effectively_updated_at.should == Time.local(1999)
+ @dependant.dependencies.effectively_updated_at.should == Time.gm(1999)
end
@@ -126,7 +126,7 @@
save_asset_at(@dependency, 1993)
@dependant = current_tag[:class].find_by_filename('dependant')
- @dependant.dependencies.effectively_updated_at.should == Time.local(1993)
+ @dependant.dependencies.effectively_updated_at.should == Time.gm(1993)
end
@@ -137,11 +137,11 @@
@dependant.content = %{<r:#{current_tag[:name]} name="dependency" />}
save_asset_at(@dependant, 1997)
- Time.stub!(:now).and_return(Time.local(1998))
+ Time.stub!(:now).and_return(Time.gm(1998))
@dependency.destroy
@dependant = current_tag[:class].find_by_filename('dependant')
- @dependant.dependencies.effectively_updated_at.should == Time.local(1998)
+ @dependant.dependencies.effectively_updated_at.should == Time.gm(1998)
end
end
@@ -152,6 +152,6 @@
private
def save_asset_at(text_asset, year)
- Time.stub!(:now).and_return(Time.local(year))
+ Time.stub!(:now).and_return(Time.gm(year))
text_asset.save!
end
@@ -6,7 +6,7 @@
class StylesNScriptsExtension < Radiant::Extension
- version "0.4"
+ version "0.4.1"
extension_name "Styles 'n Scripts"
description "Adds CSS and JS file management to Radiant"

0 comments on commit 371c37b

Please sign in to comment.