Move work package destroy tests to spec

pull/411/head
Hagen Schink 11 years ago
parent 0396768923
commit c36735f9a3
  1. 28
      spec/models/work_package_spec.rb
  2. 6
      test/unit/issue_test.rb

@ -696,6 +696,34 @@ describe WorkPackage do
end
end
describe :destroy do
let(:time_entry_1) { FactoryGirl.create(:time_entry,
project: project,
work_package: work_package) }
let(:time_entry_2) { FactoryGirl.create(:time_entry,
project: project,
work_package: work_package) }
before do
time_entry_1
time_entry_2
work_package.destroy
end
context "work package" do
subject { WorkPackage.find_by_id(work_package.id) }
it { should be_nil }
end
context "time entries" do
subject { TimeEntry.find_by_work_package_id(work_package.id) }
it { should be_nil }
end
end
describe :new_statuses_allowed_to do
let(:role) { FactoryGirl.create(:role) }

@ -16,12 +16,6 @@ class IssueTest < ActiveSupport::TestCase
fixtures :all
def test_issue_destroy
Issue.find(1).destroy
assert_nil Issue.find_by_id(1)
assert_nil TimeEntry.find_by_work_package_id(1)
end
def test_blocked
blocked_issue = Issue.find(9)
blocking_issue = Issue.find(10)

Loading…
Cancel
Save