From cf90037890805a1a68aa2e74b377d9e1b9d12aa0 Mon Sep 17 00:00:00 2001 From: Philipp Tessenow Date: Mon, 15 Apr 2013 17:14:06 +0200 Subject: [PATCH] fix TimelogHelperTests --- test/unit/helpers/timelog_helper_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit/helpers/timelog_helper_test.rb b/test/unit/helpers/timelog_helper_test.rb index 1036943e9b..7bf4b8dc4b 100644 --- a/test/unit/helpers/timelog_helper_test.rb +++ b/test/unit/helpers/timelog_helper_test.rb @@ -19,22 +19,22 @@ class TimelogHelperTest < HelperTestCase include ActionView::Helpers::DateHelper def test_activities_collection_for_select_options_should_return_array_of_activity_names_and_ids - design = FactoryGirl.create :activity, :name => "Design" - development = FactoryGirl.create :activity, :name => "Development" + design = TimeEntryActivity.find_by_name("Design") || FactoryGirl.create(:activity, :name => "Design") + development = TimeEntryActivity.find_by_name("Development") || FactoryGirl.create(:activity, :name => "Development") activities = activity_collection_for_select_options assert activities.include?(["Design", design.id]) assert activities.include?(["Development", development.id]) end def test_activities_collection_for_select_options_should_not_include_inactive_activities - inactive = FactoryGirl.create :inactive_activity, :name => "Inactive Activity" + inactive = TimeEntryActivity.find_by_name("Inactive Activity") || FactoryGirl.create(:inactive_activity, :name => "Inactive Activity") activities = activity_collection_for_select_options assert !activities.include?(["Inactive Activity", inactive.id]) end def test_activities_collection_for_select_options_should_use_the_projects_override project = FactoryGirl.create :valid_project - design = FactoryGirl.create :activity, :name => "Design" + design = TimeEntryActivity.find_by_name("Design") || FactoryGirl.create(:activity, :name => "Design") override_activity = TimeEntryActivity.create!({:name => "Design override", :parent => TimeEntryActivity.find_by_name("Design"), :project => project}) activities = activity_collection_for_select_options(nil, project)