Mercurial > hg > soundsoftware-site
comparison test/functional/boards_controller_test.rb @ 1517:dffacf8a6908 redmine-2.5
Update to Redmine SVN revision 13367 on 2.5-stable branch
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 09:29:00 +0100 |
parents | e248c7af89ec |
children |
comparison
equal
deleted
inserted
replaced
1516:b450a9d58aed | 1517:dffacf8a6908 |
---|---|
55 assert_not_nil assigns(:topics) | 55 assert_not_nil assigns(:topics) |
56 end | 56 end |
57 | 57 |
58 def test_show_should_display_sticky_messages_first | 58 def test_show_should_display_sticky_messages_first |
59 Message.update_all(:sticky => 0) | 59 Message.update_all(:sticky => 0) |
60 Message.update_all({:sticky => 1}, {:id => 1}) | 60 Message.where({:id => 1}).update_all({:sticky => 1}) |
61 | 61 |
62 get :show, :project_id => 1, :id => 1 | 62 get :show, :project_id => 1, :id => 1 |
63 assert_response :success | 63 assert_response :success |
64 | 64 |
65 topics = assigns(:topics) | 65 topics = assigns(:topics) |
137 @request.session[:user_id] = 2 | 137 @request.session[:user_id] = 2 |
138 assert_difference 'Board.count' do | 138 assert_difference 'Board.count' do |
139 post :create, :project_id => 1, :board => { :name => 'Testing', :description => 'Testing board creation'} | 139 post :create, :project_id => 1, :board => { :name => 'Testing', :description => 'Testing board creation'} |
140 end | 140 end |
141 assert_redirected_to '/projects/ecookbook/settings/boards' | 141 assert_redirected_to '/projects/ecookbook/settings/boards' |
142 board = Board.first(:order => 'id DESC') | 142 board = Board.order('id DESC').first |
143 assert_equal 'Testing', board.name | 143 assert_equal 'Testing', board.name |
144 assert_equal 'Testing board creation', board.description | 144 assert_equal 'Testing board creation', board.description |
145 end | 145 end |
146 | 146 |
147 def test_create_with_parent | 147 def test_create_with_parent |
148 @request.session[:user_id] = 2 | 148 @request.session[:user_id] = 2 |
149 assert_difference 'Board.count' do | 149 assert_difference 'Board.count' do |
150 post :create, :project_id => 1, :board => { :name => 'Testing', :description => 'Testing', :parent_id => 2} | 150 post :create, :project_id => 1, :board => { :name => 'Testing', :description => 'Testing', :parent_id => 2} |
151 end | 151 end |
152 assert_redirected_to '/projects/ecookbook/settings/boards' | 152 assert_redirected_to '/projects/ecookbook/settings/boards' |
153 board = Board.first(:order => 'id DESC') | 153 board = Board.order('id DESC').first |
154 assert_equal Board.find(2), board.parent | 154 assert_equal Board.find(2), board.parent |
155 end | 155 end |
156 | 156 |
157 def test_create_with_failure | 157 def test_create_with_failure |
158 @request.session[:user_id] = 2 | 158 @request.session[:user_id] = 2 |