1
0

Test pass: test_new_binding_target, test_new_cancel

This commit is contained in:
cryptogopher 2021-03-17 01:02:48 +01:00
parent c21c834d84
commit b53dc71d6d
2 changed files with 18 additions and 7 deletions

View File

@ -20,4 +20,15 @@ class GoalsTest < BodyTrackingSystemTestCase
assert_current_path project_goals_path(@project1)
assert_selector 'div#goals', visible: :yes, exact_text: t(:label_no_data)
end
def test_new
# Only non-binding goals can be created
end
def test_new_cancel
end
def test_create
# Only non-binding goals can be created
end
end

View File

@ -24,7 +24,7 @@ class TargetsTest < BodyTrackingSystemTestCase
end
def test_index_options_add_exposure
visit project_targets_path(@project1)
visit goal_targets_path(@project1.goals.binding)
assert_no_selector 'table#targets thead th', text: quantities(:quantities_proteins).name
within 'fieldset#options' do
select quantities(:quantities_proteins).name
@ -34,7 +34,7 @@ class TargetsTest < BodyTrackingSystemTestCase
end
def test_index_table_header_close_exposure
visit project_targets_path(@project1)
visit goal_targets_path(@project1.goals.binding)
within 'table#targets thead th', text: quantities(:quantities_energy).name do
click_link class: 'icon-close'
end
@ -42,20 +42,20 @@ class TargetsTest < BodyTrackingSystemTestCase
assert_selector 'table#targets thead th'
end
def test_new
visit project_targets_path(@project1)
def test_new_binding_target
visit goal_targets_path(@project1.goals.binding)
assert_no_selector 'form#new-target-form'
click_link t('targets.contextual.link_new_target')
assert_selector 'form#new-target-form', count: 1
within 'form#new-target-form' do
assert has_select?(t(:field_goal), selected: t('goals.binding.name'))
assert has_field?(t(:field_effective_from), with: Date.current)
assert has_field?(t(:field_effective_from), with: Date.current, count: 1)
assert has_no_link?(t('targets.form.button_delete_target'))
end
assert has_link?(t('targets.form.button_new_target'), count: 1)
end
def test_new_cancel
visit project_targets_path(@project1)
visit goal_targets_path(@project1.goals.binding)
click_link t('targets.contextual.link_new_target')
assert_selector 'form#new-target-form', count: 1
click_on t(:button_cancel)