aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/jquery.validate.js
Commit message (Expand)AuthorAgeLines
* upgrade jquery validation plugin so we are not using a patched versionStruan Donald2011-11-18-19/+23
* missed file :(Struan Donald2011-09-08-9/+27
* onsubmit js validation of new reportsStruan Donald2011-08-31-0/+1166
.0.1 Unnamed repository; edit this file 'description' to name the repository.MimesBrønn
aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/purge_request_spec.rb
blob: 02b3d685ddec186ca73cabc362f8f6cd90ec647b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# == Schema Information
#
# Table name: purge_requests
#
#  id         :integer          not null, primary key
#  url        :string(255)
#  created_at :datetime         not null
#  model      :string(255)      not null
#  model_id   :integer          not null
#

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'fakeweb'

describe PurgeRequest, "purging things" do
    before do
        PurgeRequest.destroy_all
        FakeWeb.last_request = nil
    end

    it 'should issue purge requests to the server' do
        req = PurgeRequest.new(:url => "/begone_from_here",
                               :model => "don't care",
                               :model_id => "don't care")
        req.save()
        PurgeRequest.all().count.should == 1
        PurgeRequest.purge_all()
        PurgeRequest.all().count.should == 0
    end

    it 'should fail silently for a misconfigured server' do
        FakeWeb.register_uri(:get, %r|brokenv|, :body => "BROKEN")
        config = MySociety::Config.load_default()
        config['VARNISH_HOST'] = "brokencache"
        req = PurgeRequest.new(:url => "/begone_from_here",
                               :model => "don't care",
                               :model_id => "don't care")
        req.save()
        PurgeRequest.all().count.should == 1
        PurgeRequest.purge_all()
        PurgeRequest.all().count.should == 0
    end
end