aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/admin_general_controller_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-09-20 13:38:04 +0100
committerLouise Crow <louise.crow@gmail.com>2012-09-20 13:38:04 +0100
commite32c63be6acd27534fb248e74e6394bf4fd8f28e (patch)
treebaa2a51740fed2798d798836144458444d4fc82e /spec/controllers/admin_general_controller_spec.rb
parent6d3d9d9846fa905e606f0a2aa6f1ec32122f4850 (diff)
parent44d64c22bbd49722688a680ce89bff3d1d3a8bdb (diff)
Merge branch 'release/0.6.6' into wdtk
Diffstat (limited to 'spec/controllers/admin_general_controller_spec.rb')
-rw-r--r--spec/controllers/admin_general_controller_spec.rb45
1 files changed, 33 insertions, 12 deletions
diff --git a/spec/controllers/admin_general_controller_spec.rb b/spec/controllers/admin_general_controller_spec.rb
index 820d1e7f3..dc1eb0d97 100644
--- a/spec/controllers/admin_general_controller_spec.rb
+++ b/spec/controllers/admin_general_controller_spec.rb
@@ -1,18 +1,39 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
-describe AdminGeneralController, "when viewing front page of admin interface" do
- integrate_views
- before { basic_auth_login @request }
-
- it "should render the front page" do
- get :index, :suppress_redirect => 1
- response.should render_template('index')
- end
+describe AdminGeneralController do
+
+ describe "when viewing front page of admin interface" do
+
+ integrate_views
+ before { basic_auth_login @request }
+
+ it "should render the front page" do
+ get :index, :suppress_redirect => 1
+ response.should render_template('index')
+ end
+
+ it "should redirect to include trailing slash" do
+ get :index
+ response.should redirect_to(:controller => 'admin_general',
+ :action => 'index')
+ end
- it "should redirect to include trailing slash" do
- get :index
- response.should redirect_to(:controller => 'admin_general',
- :action => 'index')
end
+ describe 'when viewing the timeline' do
+
+ it 'should assign an array of events in order of descending date to the view' do
+ get :timeline, :all => 1
+ previous_event = nil
+ previous_event_at = nil
+ assigns[:events].each do |event, event_at|
+ if previous_event
+ (event_at <= previous_event_at).should be_true
+ end
+ previous_event = event
+ previous_event_at = event_at
+ end
+ end
+
+ end
end