an ugly test passes by making it more ugly…

pull/1186/head
Martin Linkhorst 12 years ago
parent d8e3513b08
commit 7f0ed5a47c
  1. 16
      test/functional/project_enumerations_controller_test.rb

@ -134,17 +134,17 @@ class ProjectEnumerationsControllerTest < ActionController::TestCase
# TODO: Need to cause an exception on create but these tests
# aren't setup for mocking. Just create a record now so the
# second one is a duplicate
parent = TimeEntryActivity.find(9)
# parent = TimeEntryActivity.find(9)
parent = TimeEntryActivity.new
parent.force_attribute = { :name => parent.name, :project_id => 1, :position => parent.position, :active => true }
parent.force_attributes = { :name => parent.name, :project_id => 1, :position => parent.position, :active => true }
parent.save(:validate => false)
TimeEntry.create!({ :project_id => 1,
:hours => 1.0,
:user => User.find(1),
:issue_id => 3,
:activity_id => 10,
:spent_on => '2009-01-01' })
project = Project.find(1)
project.time_entries.create!(:hours => 1.0,
:user => User.find(1),
:issue_id => 3,
:activity_id => 10,
:spent_on => '2009-01-01')
assert_equal 3, TimeEntry.find_all_by_activity_id_and_project_id(9, 1).size
assert_equal 1, TimeEntry.find_all_by_activity_id_and_project_id(10, 1).size

Loading…
Cancel
Save