forked from mysociety/alaveteli
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add EU country mappings and accessors
- Loading branch information
1 parent
618f231
commit a267777
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- encoding : utf-8 -*- | ||
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') | ||
|
||
describe WorldFOIWebsites do | ||
|
||
describe '.can_ask_the_eu?' do | ||
|
||
it 'is false if the current site is AskTheEU' do | ||
allow(AlaveteliConfiguration). | ||
to receive(:domain).and_return('www.asktheeu.org') | ||
expect(described_class.can_ask_the_eu?('ES')).to eq(false) | ||
end | ||
|
||
it 'is false if the current user is not in an EU country' do | ||
expect(described_class.can_ask_the_eu?('US')).to eq(false) | ||
end | ||
|
||
it 'is true if the current user is in an EU country' do | ||
expect(described_class.can_ask_the_eu?('ES')).to eq(true) | ||
end | ||
|
||
end | ||
|
||
end |