blob: 1bafd0c8f488392cd892d791f5ffa82652dd7168 (
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
|
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe ServicesController, "when using web services" do
integrate_views
it "should show no alaveteli message when in the deployed country" do
config = MySociety::Config.load_default()
config['ISO_COUNTRY_CODE'] = "DE"
controller.stub!(:country_from_ip).and_return('DE')
get :other_country_message
response.body.should == ""
end
it "should show an alaveteli message when not in the deployed country and in a country with no FOI website" do
config = MySociety::Config.load_default()
config['ISO_COUNTRY_CODE'] = "DE"
controller.stub!(:country_from_ip).and_return('ZZ')
get :other_country_message
response.body.should match(/outside Germany/)
end
it "should show link to other FOI website when not in the deployed country" do
config = MySociety::Config.load_default()
config['ISO_COUNTRY_CODE'] = "ZZ"
controller.stub!(:country_from_ip).and_return('DE')
get :other_country_message
response.body.should match(/within Germany/)
end
end
|