Curious if anyone has Shoulda working with test/unit in Rails 3. I tried it
this morning and am getting:
test/unit/practice_member_test.rb:4:in `<class:PracticeMemberTest>':
undefined method `context' for PracticeMemberTest:Class (NoMethodError)
Now, I have a Rails 3 project with Rspec including Shoulda also and it works
fine. I tried placing "require 'shoulda'" in test helper to no avail, but
when I run the debugger and type Shoulda, the object is found.
It it helps, here is my test:
require 'test_helper'
class PracticeMemberTest < Test::Unit::TestCase
context "practice member" do
should "get global practice member count not including Demo Practice" do
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
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.