README.rdoc in shoulda-2.0.1 vs README.rdoc in shoulda-2.0.2
- old
+ new
@@ -88,9 +88,22 @@
should "do something else really cool" do
assert_equal 1, assigns(:user).id
end
end
+Test entire controllers in a few lines...
+
+ class PostsControllerTest < Test::Unit::TestCase
+ should_be_restful do |resource|
+ resource.parent = :user
+
+ resource.create.params = { :title => "first post", :body => 'blah blah blah'}
+ resource.update.params = { :title => "changed" }
+ end
+ end
+
+should_be_restful generates 40 tests on the fly, for both html and xml requests.
+
=== Helpful Assertions (ThoughtBot::Shoulda::Assertions)
More to come here, but have fun with what's there.
assert_same_elements([:a, :b, :c], [:c, :a, :b])