Added defaults load test
This commit is contained in:
parent
6ba8ad5376
commit
8f2a455561
@ -46,7 +46,7 @@ class BodyTrackersController < ApplicationController
|
|||||||
failed_objects += available_quantities.values.reject { |o| o.persisted? || o.save }
|
failed_objects += available_quantities.values.reject { |o| o.persisted? || o.save }
|
||||||
end
|
end
|
||||||
|
|
||||||
new_quantities_count = @project.quantities(true).size - quantities_count
|
new_quantities_count = @project.quantities.reload.size - quantities_count
|
||||||
flash[:notice] += ", #{new_quantities_count > 0 ? new_quantities_count : "no" } new" \
|
flash[:notice] += ", #{new_quantities_count > 0 ? new_quantities_count : "no" } new" \
|
||||||
" #{'quantity'.pluralize(new_quantities_count)}"
|
" #{'quantity'.pluralize(new_quantities_count)}"
|
||||||
|
|
||||||
|
18
test/system/body_trackers_test.rb
Normal file
18
test/system/body_trackers_test.rb
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
require File.expand_path('../../application_system_test_case', __FILE__)
|
||||||
|
|
||||||
|
class BodyTrackersTest < BodyTrackingSystemTestCase
|
||||||
|
def setup
|
||||||
|
super
|
||||||
|
@project1 = projects(:projects_001)
|
||||||
|
log_user 'jsmith', 'jsmith'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_defaults_load
|
||||||
|
visit project_body_trackers_path(@project1)
|
||||||
|
accept_alert t('layouts.sidebar.confirm_defaults') do
|
||||||
|
click_link t('layouts.sidebar.link_defaults')
|
||||||
|
end
|
||||||
|
assert_selector 'div#flash_notice'
|
||||||
|
assert_no_selector 'div#flash_error'
|
||||||
|
end
|
||||||
|
end
|
@ -3,9 +3,7 @@ require File.expand_path('../../application_system_test_case', __FILE__)
|
|||||||
class TargetsTest < BodyTrackingSystemTestCase
|
class TargetsTest < BodyTrackingSystemTestCase
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
|
|
||||||
@project1 = projects(:projects_001)
|
@project1 = projects(:projects_001)
|
||||||
|
|
||||||
log_user 'jsmith', 'jsmith'
|
log_user 'jsmith', 'jsmith'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user