aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/general_controller_spec.rb11
-rw-r--r--spec/controllers/request_controller_spec.rb8
2 files changed, 15 insertions, 4 deletions
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb
index 9a88dbc3a..4a1c8b134 100644
--- a/spec/controllers/general_controller_spec.rb
+++ b/spec/controllers/general_controller_spec.rb
@@ -19,8 +19,11 @@ end
describe GeneralController, 'when getting the blog feed' do
- it 'should add a lang param correctly to a url with no querystring' do
+ before do
AlaveteliConfiguration.stub!(:blog_feed).and_return("http://blog.example.com")
+ end
+
+ it 'should add a lang param correctly to a url with no querystring' do
get :blog
assigns[:feed_url].should == "http://blog.example.com?lang=en"
end
@@ -31,6 +34,12 @@ describe GeneralController, 'when getting the blog feed' do
assigns[:feed_url].should == "http://blog.example.com?alt=rss&lang=en"
end
+ it 'should parse an item from an example feed' do
+ controller.stub!(:quietly_try_to_open).and_return(load_file_fixture("blog_feed.atom"))
+ get :blog
+ assigns[:blog_items].count.should == 1
+ end
+
end
describe GeneralController, "when showing the frontpage" do
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 4161f1118..657837c72 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -907,6 +907,7 @@ describe RequestController, "when searching for an authority" do
# so we make sure we're logged in, just in case
before do
@user = users(:bob_smith_user)
+ get_fixtures_xapian_index
end
it "should return nothing for the empty query string" do
@@ -918,7 +919,6 @@ describe RequestController, "when searching for an authority" do
end
it "should return matching bodies" do
- get_fixtures_xapian_index
session[:user_id] = @user.id
get :select_authority, :query => "Quango"
@@ -2261,6 +2261,10 @@ end
describe RequestController, "when showing similar requests" do
render_views
+ before do
+ get_fixtures_xapian_index
+ end
+
it "should work" do
get :similar, :url_title => info_requests(:badger_request).url_title
response.should render_template("request/similar")
@@ -2268,8 +2272,6 @@ describe RequestController, "when showing similar requests" do
end
it "should show similar requests" do
- get_fixtures_xapian_index
-
badger_request = info_requests(:badger_request)
get :similar, :url_title => badger_request.url_title