comparison test/functional/queries_controller_test.rb @ 524:1248a47e81b3 feature_36

Merge from branch "luisf"
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Mon, 25 Jul 2011 14:39:38 +0100
parents cbce1fd3b1b7
children cbb26bc654de
comparison
equal deleted inserted replaced
519:3be6bc3c2a17 524:1248a47e81b3
13 # 13 #
14 # You should have received a copy of the GNU General Public License 14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software 15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 require File.dirname(__FILE__) + '/../test_helper' 18 require File.expand_path('../../test_helper', __FILE__)
19 require 'queries_controller' 19 require 'queries_controller'
20 20
21 # Re-raise errors caught by the controller. 21 # Re-raise errors caught by the controller.
22 class QueriesController; def rescue_action(e) raise e end; end 22 class QueriesController; def rescue_action(e) raise e end; end
23 23
62 @request.session[:user_id] = 2 62 @request.session[:user_id] = 2
63 post :new, 63 post :new,
64 :project_id => 'ecookbook', 64 :project_id => 'ecookbook',
65 :confirm => '1', 65 :confirm => '1',
66 :default_columns => '1', 66 :default_columns => '1',
67 :fields => ["status_id", "assigned_to_id"], 67 :f => ["status_id", "assigned_to_id"],
68 :operators => {"assigned_to_id" => "=", "status_id" => "o"}, 68 :op => {"assigned_to_id" => "=", "status_id" => "o"},
69 :values => { "assigned_to_id" => ["1"], "status_id" => ["1"]}, 69 :v => { "assigned_to_id" => ["1"], "status_id" => ["1"]},
70 :query => {"name" => "test_new_project_public_query", "is_public" => "1"} 70 :query => {"name" => "test_new_project_public_query", "is_public" => "1"}
71 71
72 q = Query.find_by_name('test_new_project_public_query') 72 q = Query.find_by_name('test_new_project_public_query')
73 assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook', :query_id => q 73 assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook', :query_id => q
74 assert q.is_public? 74 assert q.is_public?
99 post :new, 99 post :new,
100 :confirm => '1', 100 :confirm => '1',
101 :fields => ["status_id", "assigned_to_id"], 101 :fields => ["status_id", "assigned_to_id"],
102 :operators => {"assigned_to_id" => "=", "status_id" => "o"}, 102 :operators => {"assigned_to_id" => "=", "status_id" => "o"},
103 :values => { "assigned_to_id" => ["me"], "status_id" => ["1"]}, 103 :values => { "assigned_to_id" => ["me"], "status_id" => ["1"]},
104 :query => {"name" => "test_new_global_private_query", "is_public" => "1", "column_names" => ["", "tracker", "subject", "priority", "category"]} 104 :query => {"name" => "test_new_global_private_query", "is_public" => "1"},
105 :c => ["", "tracker", "subject", "priority", "category"]
105 106
106 q = Query.find_by_name('test_new_global_private_query') 107 q = Query.find_by_name('test_new_global_private_query')
107 assert_redirected_to :controller => 'issues', :action => 'index', :project_id => nil, :query_id => q 108 assert_redirected_to :controller => 'issues', :action => 'index', :project_id => nil, :query_id => q
108 assert !q.is_public? 109 assert !q.is_public?
109 assert !q.has_default_columns? 110 assert !q.has_default_columns?