diff test/functional/boards_controller_test.rb @ 1526:404aa68d4227

Merge from live branch
author Chris Cannam
date Thu, 11 Sep 2014 12:46:20 +0100
parents dffacf8a6908
children
line wrap: on
line diff
--- a/test/functional/boards_controller_test.rb	Mon Mar 17 08:57:04 2014 +0000
+++ b/test/functional/boards_controller_test.rb	Thu Sep 11 12:46:20 2014 +0100
@@ -1,5 +1,5 @@
 # Redmine - project management software
-# Copyright (C) 2006-2012  Jean-Philippe Lang
+# Copyright (C) 2006-2014  Jean-Philippe Lang
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -57,7 +57,7 @@
 
   def test_show_should_display_sticky_messages_first
     Message.update_all(:sticky => 0)
-    Message.update_all({:sticky => 1}, {:id => 1})
+    Message.where({:id => 1}).update_all({:sticky => 1})
 
     get :show, :project_id => 1, :id => 1
     assert_response :success
@@ -90,8 +90,9 @@
     assert_response :success
     assert_template 'show'
 
-    assert_tag 'form', :attributes => {:id => 'message-form'}
-    assert_tag 'input', :attributes => {:name => 'message[subject]'}
+    assert_select 'form#message-form' do
+      assert_select 'input[name=?]', 'message[subject]'
+    end
   end
 
   def test_show_atom
@@ -116,7 +117,7 @@
 
     assert_select 'select[name=?]', 'board[parent_id]' do
       assert_select 'option', (Project.find(1).boards.size + 1)
-      assert_select 'option[value=]', :text => ''
+      assert_select 'option[value=]', :text => ' '
       assert_select 'option[value=1]', :text => 'Help'
     end
   end
@@ -138,7 +139,7 @@
       post :create, :project_id => 1, :board => { :name => 'Testing', :description => 'Testing board creation'}
     end
     assert_redirected_to '/projects/ecookbook/settings/boards'
-    board = Board.first(:order => 'id DESC')
+    board = Board.order('id DESC').first
     assert_equal 'Testing', board.name
     assert_equal 'Testing board creation', board.description
   end
@@ -149,7 +150,7 @@
       post :create, :project_id => 1, :board => { :name => 'Testing', :description => 'Testing', :parent_id => 2}
     end
     assert_redirected_to '/projects/ecookbook/settings/boards'
-    board = Board.first(:order => 'id DESC')
+    board = Board.order('id DESC').first
     assert_equal Board.find(2), board.parent
   end