diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-09-20 15:06:32 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-09-20 15:06:32 +0100 |
commit | add084ee6047d3cae72e3e445135b122d8ba2cc8 (patch) | |
tree | f9763b73753c44562d6572035ab71b4bae2957a0 /spec/controllers/admin_general_controller_spec.rb | |
parent | 69103f5e83d538cd3aa9a3ea39cc5736aaec21e8 (diff) | |
parent | aebcdc082f277b3569d1300ebeda43c503d8aec5 (diff) |
Merge branch 'release/0.6.6'0.6.6
Conflicts:
locale/cs/app.po
locale/es/app.po
Diffstat (limited to 'spec/controllers/admin_general_controller_spec.rb')
-rw-r--r-- | spec/controllers/admin_general_controller_spec.rb | 45 |
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 |