I posted this in other places, but did not answer. Attempts to make Worka work inside Test / Unit in Rails 3.0.3 (1.9.2). When I try to run the test (copied below), I get this error:
test / unit / practice_member_test.rb: 4: in <class:PracticeMemberTest>': undefined methodcontext 'for PracticeMemberTest: Class (NoMethodError)
Please note that I have another Rails 3 project with Rspec, including Shoulda, and it works fine through Rspec. In a failed project, I tried to put βrequireaβ in the test assistant to no avail, but when I run the debugger and type βPasteβ, the object is found, so the library loads.
Here is my test:
test_helper required
class PracticeMemberTest <Test :: Unit :: TestCase context "practice participant" do
should "count the number of participants in the global practice, not including the demo practice" assert_equal PracticeMember.practice_members_global_count, 0
practice = Factory.create(:practice_one)
practice_member = Factory.create(:practice_member)
practice_member.practice_id = practice.id
practice_member.save
practice_member = Factory.create(:practice_member)
practice_member.practice_id = practice.id
practice_member.save
assert_equal PracticeMember.practice_members_global_count, 2
end
end end
I must be ignoring something, as I have not seen anyone with the same problem.
source
share