Added is_binding attribute to Goal
Fixed test_index to check for data rows only
This commit is contained in:
@@ -21,7 +21,7 @@ class BodyTrackingSystemTestCase < ApplicationSystemTestCase
|
||||
end
|
||||
|
||||
fixtures :projects
|
||||
plugin_fixtures :quantities, :units, :exposures, :targets, :quantity_values
|
||||
plugin_fixtures :quantities, :units, :goals, :exposures, :targets, :quantity_values
|
||||
|
||||
include AbstractController::Translation
|
||||
|
||||
|
||||
2
test/fixtures/exposures.yml
vendored
2
test/fixtures/exposures.yml
vendored
@@ -1,4 +1,4 @@
|
||||
exposures_01:
|
||||
view_type: Goal
|
||||
view_id: <%= Project.find(1).goals.binding.id %>
|
||||
view: goals_binding
|
||||
quantity: quantities_energy
|
||||
|
||||
4
test/fixtures/goals.yml
vendored
Normal file
4
test/fixtures/goals.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
goals_binding:
|
||||
project_id: 1
|
||||
is_binding: true
|
||||
name: '- binding -'
|
||||
2
test/fixtures/quantities.yml
vendored
2
test/fixtures/quantities.yml
vendored
@@ -1,5 +1,5 @@
|
||||
quantities_energy:
|
||||
project: projects_001
|
||||
project_id: 1
|
||||
domain: diet
|
||||
parent: null
|
||||
lft: 1
|
||||
|
||||
2
test/fixtures/targets.yml
vendored
2
test/fixtures/targets.yml
vendored
@@ -1,4 +1,4 @@
|
||||
targets_01:
|
||||
goal_id: <%= Project.find(1).goals.binding.id %>
|
||||
goal: goals_binding
|
||||
condition: '=='
|
||||
effective_from: <%= 1.week.ago.to_s(:db) %>
|
||||
|
||||
6
test/fixtures/units.yml
vendored
6
test/fixtures/units.yml
vendored
@@ -1,14 +1,14 @@
|
||||
units_gram:
|
||||
project: projects_001
|
||||
project_id: 1
|
||||
name: 'gram'
|
||||
shortname: 'g'
|
||||
|
||||
units_percent:
|
||||
project: projects_001
|
||||
project_id: 1
|
||||
name: 'percent'
|
||||
shortname: '%'
|
||||
|
||||
units_kcal:
|
||||
project: projects_001
|
||||
project_id: 1
|
||||
name: 'kilocalorie'
|
||||
shortname: 'kcal'
|
||||
|
||||
@@ -18,11 +18,14 @@ class TargetsTest < BodyTrackingSystemTestCase
|
||||
assert_not_equal 0, @project1.targets.count
|
||||
visit project_targets_path(@project1)
|
||||
assert_current_path project_targets_path(@project1)
|
||||
assert_selector 'table#targets tr', count: @project1.targets.count
|
||||
assert_selector 'table#targets tbody tr', count: @project1.targets.count
|
||||
end
|
||||
|
||||
def test_index_without_targets
|
||||
#assert_equal 0, @project1.targets.count
|
||||
#assert_selector 'div#targets', visible: :yes, exact_text: l(:label_no_data)
|
||||
end
|
||||
|
||||
def test_create_saves_binding_goal_if_nonexistent
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user