summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-01 18:24:33 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-01 18:24:33 +0000
commit733fef458c5c0aa7b0d3231f849dfc3245143ddb (patch)
treec2cc4cdb0adb3fa640f963a2dcf460130b16c232 /test
parent121ce2a3900cd9fcb67df7fbcb7bd660d3251f79 (diff)
downloadredmine-733fef458c5c0aa7b0d3231f849dfc3245143ddb.tar.gz
redmine-733fef458c5c0aa7b0d3231f849dfc3245143ddb.zip
Replaced group[lastname] parameter with group[name].
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9745 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/groups_controller_test.rb11
-rw-r--r--test/object_helpers.rb2
-rw-r--r--test/unit/group_test.rb4
3 files changed, 10 insertions, 7 deletions
diff --git a/test/functional/groups_controller_test.rb b/test/functional/groups_controller_test.rb
index d28322810..efdca3883 100644
--- a/test/functional/groups_controller_test.rb
+++ b/test/functional/groups_controller_test.rb
@@ -40,11 +40,12 @@ class GroupsControllerTest < ActionController::TestCase
get :new
assert_response :success
assert_template 'new'
+ assert_select 'input[name=?]', 'group[name]'
end
def test_create
assert_difference 'Group.count' do
- post :create, :group => {:lastname => 'New group'}
+ post :create, :group => {:name => 'New group'}
end
assert_redirected_to '/groups'
group = Group.first(:order => 'id DESC')
@@ -54,7 +55,7 @@ class GroupsControllerTest < ActionController::TestCase
def test_create_and_continue
assert_difference 'Group.count' do
- post :create, :group => {:lastname => 'New group'}, :continue => 'Create and continue'
+ post :create, :group => {:name => 'New group'}, :continue => 'Create and continue'
end
assert_redirected_to '/groups/new'
group = Group.first(:order => 'id DESC')
@@ -63,7 +64,7 @@ class GroupsControllerTest < ActionController::TestCase
def test_create_with_failure
assert_no_difference 'Group.count' do
- post :create, :group => {:lastname => ''}
+ post :create, :group => {:name => ''}
end
assert_response :success
assert_template 'new'
@@ -79,14 +80,14 @@ class GroupsControllerTest < ActionController::TestCase
def test_update
new_name = 'New name'
- put :update, :id => 10, :group => {:lastname => new_name}
+ put :update, :id => 10, :group => {:name => new_name}
assert_redirected_to '/groups'
group = Group.find(10)
assert_equal new_name, group.name
end
def test_update_with_failure
- put :update, :id => 10, :group => {:lastname => ''}
+ put :update, :id => 10, :group => {:name => ''}
assert_response :success
assert_template 'edit'
end
diff --git a/test/object_helpers.rb b/test/object_helpers.rb
index 6db4336cf..a2d7c958f 100644
--- a/test/object_helpers.rb
+++ b/test/object_helpers.rb
@@ -21,7 +21,7 @@ module ObjectHelpers
@generated_group_name ||= 'Group 0'
@generated_group_name.succ!
group = Group.new(attributes)
- group.lastname = @generated_group_name if group.lastname.blank?
+ group.name = @generated_group_name if group.name.blank?
yield group if block_given?
group.save!
group
diff --git a/test/unit/group_test.rb b/test/unit/group_test.rb
index 0351dd671..3d7c2da26 100644
--- a/test/unit/group_test.rb
+++ b/test/unit/group_test.rb
@@ -31,8 +31,10 @@ class GroupTest < ActiveSupport::TestCase
include Redmine::I18n
def test_create
- g = Group.new(:lastname => 'New group')
+ g = Group.new(:name => 'New group')
assert g.save
+ g.reload
+ assert_equal 'New group', g.name
end
def test_blank_name_error_message