summaryrefslogtreecommitdiffstats
path: root/test/functional/trackers_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-02 16:55:16 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-02 16:55:16 +0000
commit3a32edc3bd108ed07ef2802fbf13dcc886d76607 (patch)
treed6db898248dfa8b008e452fb99d0540fb3035779 /test/functional/trackers_controller_test.rb
parent462c986452e25d00b4a76db6494b2649ca9d2285 (diff)
downloadredmine-3a32edc3bd108ed07ef2802fbf13dcc886d76607.tar.gz
redmine-3a32edc3bd108ed07ef2802fbf13dcc886d76607.zip
Adds a view for editing all trackers fields.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10283 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/trackers_controller_test.rb')
-rw-r--r--test/functional/trackers_controller_test.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/functional/trackers_controller_test.rb b/test/functional/trackers_controller_test.rb
index caa1ec9eb..9a8ec54b0 100644
--- a/test/functional/trackers_controller_test.rb
+++ b/test/functional/trackers_controller_test.rb
@@ -185,4 +185,34 @@ class TrackersControllerTest < ActionController::TestCase
assert_redirected_to :action => 'index'
assert_not_nil flash[:error]
end
+
+ def test_get_fields
+ get :fields
+ assert_response :success
+ assert_template 'fields'
+
+ assert_select 'form' do
+ assert_select 'input[type=checkbox][name=?][value=assigned_to_id]', 'trackers[1][core_fields][]'
+ assert_select 'input[type=checkbox][name=?][value=2]', 'trackers[1][custom_field_ids][]'
+
+ assert_select 'input[type=hidden][name=?][value=]', 'trackers[1][core_fields][]'
+ assert_select 'input[type=hidden][name=?][value=]', 'trackers[1][custom_field_ids][]'
+ end
+ end
+
+ def test_post_fields
+ post :fields, :trackers => {
+ '1' => {'core_fields' => ['assigned_to_id', 'due_date', ''], 'custom_field_ids' => ['1', '2']},
+ '2' => {'core_fields' => [''], 'custom_field_ids' => ['']}
+ }
+ assert_redirected_to '/trackers/fields'
+
+ tracker = Tracker.find(1)
+ assert_equal %w(assigned_to_id due_date), tracker.core_fields
+ assert_equal [1, 2], tracker.custom_field_ids.sort
+
+ tracker = Tracker.find(2)
+ assert_equal [], tracker.core_fields
+ assert_equal [], tracker.custom_field_ids.sort
+ end
end