New test: test_index_options_add_column
This commit is contained in:
parent
bd9b5f04f4
commit
07eda42de4
1
test/fixtures/goals.yml
vendored
1
test/fixtures/goals.yml
vendored
@ -2,6 +2,7 @@ goals_binding:
|
|||||||
project_id: 1
|
project_id: 1
|
||||||
is_binding: true
|
is_binding: true
|
||||||
name: "<%= I18n.t 'targets.form.binding_goal' %>"
|
name: "<%= I18n.t 'targets.form.binding_goal' %>"
|
||||||
|
|
||||||
goals_non_binding:
|
goals_non_binding:
|
||||||
project_id: 1
|
project_id: 1
|
||||||
is_binding: false
|
is_binding: false
|
||||||
|
9
test/fixtures/quantities.yml
vendored
9
test/fixtures/quantities.yml
vendored
@ -6,3 +6,12 @@ quantities_energy:
|
|||||||
rgt: 2
|
rgt: 2
|
||||||
name: Energy
|
name: Energy
|
||||||
description: Total energy
|
description: Total energy
|
||||||
|
|
||||||
|
quantities_proteins:
|
||||||
|
project_id: 1
|
||||||
|
domain: diet
|
||||||
|
parent: null
|
||||||
|
lft: 3
|
||||||
|
rgt: 4
|
||||||
|
name: Proteins
|
||||||
|
description: Total amount of proteins
|
||||||
|
1
test/fixtures/roles.yml
vendored
1
test/fixtures/roles.yml
vendored
@ -6,6 +6,7 @@ roles_body_trackers_manager:
|
|||||||
permissions: |
|
permissions: |
|
||||||
- :manage_body_trackers
|
- :manage_body_trackers
|
||||||
- :view_body_trackers
|
- :view_body_trackers
|
||||||
|
|
||||||
roles_body_trackers_viewer:
|
roles_body_trackers_viewer:
|
||||||
name: View body trackers
|
name: View body trackers
|
||||||
builtin: false
|
builtin: false
|
||||||
|
@ -21,6 +21,17 @@ class TargetsTest < BodyTrackingSystemTestCase
|
|||||||
assert_selector 'div#targets', visible: :yes, exact_text: t(:label_no_data)
|
assert_selector 'div#targets', visible: :yes, exact_text: t(:label_no_data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_index_options_add_column
|
||||||
|
visit project_targets_path(@project1)
|
||||||
|
assert_no_selector 'table#targets thead th', text: quantities(:quantities_proteins).name
|
||||||
|
within 'fieldset#options' do
|
||||||
|
select quantities(:quantities_proteins).name
|
||||||
|
click_on t(:button_add)
|
||||||
|
end
|
||||||
|
assert_selector 'table#targets thead th', text: quantities(:quantities_proteins).name
|
||||||
|
end
|
||||||
|
|
||||||
|
# TODO: rename to test_new; move checking of default values here
|
||||||
def test_index_show_and_hide_new_target_form
|
def test_index_show_and_hide_new_target_form
|
||||||
visit project_targets_path(@project1)
|
visit project_targets_path(@project1)
|
||||||
assert_no_selector 'form#new-target-form'
|
assert_no_selector 'form#new-target-form'
|
||||||
@ -77,6 +88,11 @@ class TargetsTest < BodyTrackingSystemTestCase
|
|||||||
# * restoring user input
|
# * restoring user input
|
||||||
# * removing empty targets
|
# * removing empty targets
|
||||||
|
|
||||||
|
# TODO: test edit and update separately
|
||||||
def test_update
|
def test_update
|
||||||
|
visit project_targets_path(@project1)
|
||||||
|
within 'table#targets tbody tr' do
|
||||||
|
click_link t(:button_edit)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user