Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Switched off homepage and replaced with 301 redirect

  • Loading branch information...
njh committed Apr 11, 2019
1 parent e5e2d4e commit 83c59178291a3cc584047d7418d2ec38ed04952b
Showing with 7 additions and 25 deletions.
  1. +4 −3 dbpedialite.rb
  2. +3 −22 spec/dbpedialite_spec.rb
@@ -99,9 +99,10 @@ def format_iso8061(datetime)
end

get '/' do
headers 'Cache-Control' => 'public,max-age=3600'
@readme = RDiscount.new(File.read(File.join(File.dirname(__FILE__), 'README.md')))
erb :index
headers 'Cache-Control' => 'public,max-age=31536000'
redirect "https://github.com/njh/dbpedialite", 301
#@readme = RDiscount.new(File.read(File.join(File.dirname(__FILE__), 'README.md')))
#erb :index
end

get %r{/search\.?([a-z]*)} do |format|
@@ -25,28 +25,9 @@ def app
get '/'
end

it "should be successful" do
last_response.should be_ok
end

it "should be of type text/html" do
last_response.content_type.should == 'text/html;charset=utf-8'
end

it "should be cachable" do
last_response.headers['Cache-Control'].should =~ /max-age=([1-9]+)/
end

it "should have CORS enabled" do
last_response.headers['Access-Control-Allow-Origin'].should == '*'
end

it "should contain the readme text" do
last_response.body.should =~ /take some of the structured data/
end

it "should contain the bookmarklet" do
last_response.body.should =~ %r|javascript:location.href='http://example.org/flipr\?url=|
it "should redirect" do
last_response.status.should == 301
last_response.location.should == 'https://github.com/njh/dbpedialite'
end

it "should be cachable" do

0 comments on commit 83c5917

Please sign in to comment.
You can’t perform that action at this time.