Sha256: 92c20d04478e7499cd67e2a62e270a67d66bba523953a2f7d9e0686180a34f9d
Contents?: true
Size: 1.79 KB
Versions: 1
Compression:
Stored size: 1.79 KB
Contents
require File.dirname(__FILE__) + '/../test_helper' require 'welcome_controller' # Re-raise errors caught by the controller. class WelcomeController; def rescue_action(e) raise e end; end class WelcomeControllerTest < ActionController::TestCase main_scenario def setup @controller = WelcomeController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new @request.session[:user_id] = 1000001 end def test_index_redirect_to_login @request.session[:user_id] = nil get :index assert_response :redirect assert_redirected_to :controller => 'user', :action => :login end def test_index_first_time Work.delete_all Estimate.delete_all TaskFile.delete_all Task.delete_all Backlog.delete_all get :index assert_response :redirect assert_redirected_to :controller => 'backlogs', :action => :new end def test_index_active_period Work.delete(works(:started).id) get :index assert_response :redirect assert_redirected_to :controller => 'periods', :action => :show, :id => periods(:ancient) end def test_index_list_started get :index assert_response :redirect assert_redirected_to :controller => 'tasks', :action => :list_started end def test_index_no_active_sprints periods(:active).update_attributes!(:end_on => (Date.today - 1)) Work.delete(works(:started).id) tasks(:first).finish(Task::COMPLETED, true) tasks(:another).finish(Task::COMPLETED, true) tasks(:started).finish(Task::COMPLETED, true) tasks(:subsubtask).finish(Task::COMPLETED, true) tasks(:in_ancient).finish(Task::COMPLETED, true) get :index assert_response :redirect assert_redirected_to :controller => 'backlogs', :action => :show, :id => 1 end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
backlog-0.36.2 | test/functional/welcome_controller_test.rb |