diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-06-01 18:17:27 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-06-01 18:17:27 +0000 |
commit | 966f238da459fda40be8db48904dad7e4266a443 (patch) | |
tree | 33932b6969f6a6a55e8f8c6461de2c837d03ca07 /test/integration/admin_test.rb | |
parent | b834e81d7f41121fc6d9bef95ee090f8f466493e (diff) | |
download | redmine-966f238da459fda40be8db48904dad7e4266a443.tar.gz redmine-966f238da459fda40be8db48904dad7e4266a443.zip |
Use Rails 5 syntax for integration tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@16586 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/admin_test.rb')
-rw-r--r-- | test/integration/admin_test.rb | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/test/integration/admin_test.rb b/test/integration/admin_test.rb index f16f10bd1..a64200e08 100644 --- a/test/integration/admin_test.rb +++ b/test/integration/admin_test.rb @@ -31,11 +31,14 @@ class AdminTest < Redmine::IntegrationTest get "/users/new" assert_response :success - post "/users", - :user => { :login => "psmith", :firstname => "Paul", - :lastname => "Smith", :mail => "psmith@somenet.foo", - :language => "en", :password => "psmith09", - :password_confirmation => "psmith09" } + post "/users", :params => { + :user => { + :login => "psmith", :firstname => "Paul", + :lastname => "Smith", :mail => "psmith@somenet.foo", + :language => "en", :password => "psmith09", + :password_confirmation => "psmith09" + } + } user = User.find_by_login("psmith") assert_kind_of User, user @@ -45,16 +48,24 @@ class AdminTest < Redmine::IntegrationTest assert_kind_of User, logged_user assert_equal "Paul", logged_user.firstname - put "/users/#{user.id}", :id => user.id, :user => { :status => User::STATUS_LOCKED } + put "/users/#{user.id}", :params => { + :id => user.id, + :user => { + :status => User::STATUS_LOCKED + } + } assert_redirected_to "/users/#{ user.id }/edit" locked_user = User.try_to_login("psmith", "psmith09") assert_nil locked_user end test "Add a user as an anonymous user should fail" do - post '/users', - :user => { :login => 'psmith', :firstname => 'Paul'}, - :password => "psmith09", :password_confirmation => "psmith09" + post '/users', :params => { + :user => { + :login => 'psmith', :firstname => 'Paul', + :password => "psmith09", :password_confirmation => "psmith09" + } + } assert_response :redirect assert_redirected_to "/login?back_url=http%3A%2F%2Fwww.example.com%2Fusers" end |