spec/firefly/server_spec.rb in firefly-1.0.1 vs spec/firefly/server_spec.rb in firefly-1.1.0

- old
+ new

@@ -12,9 +12,30 @@ get '/' last_response.should be_ok end end + describe "QR Codes" do + before(:each) do + @url = Firefly::Url.create(:url => 'http://example.com/123', :code => 'alpha') + end + + it "should return a 200 status" do + get '/alpha.png' + last_response.should be_ok + end + + it "should return a PNG image" do + get '/alpha.png' + last_response.headers['Content-Type'].should eql('image/png') + end + + it "should cache-control to 1 month" do + get '/alpha.png' + last_response.headers['Cache-Control'].should eql('public, max-age=2592000') + end + end + describe "redirecting" do it "should redirect to the original URL" do fake = Firefly::Url.create(:url => 'http://example.com/123', :code => 'alpha') get '/alpha'