RSpec stories are a way of doing integration and acceptance testing using plaintext executable tests. You can use them in Merb as well as Rails. Here's how.
Install edge Merb; the latest gem (0.9.2) will not work. You need merb-core, merb-more, and merb-plugins.
Merb-plugins gives you the merb_stories gem, so you don't need to install that separately.
Add this line to your app's init.rb:
1 dependency "merb_stories" if Merb.environment == "test"
(Note that merb_stories' README file is wrong about this, for now).
Now generate your story:
1 merb-gen story mystory
Now run your story:
1 rake story\[mystory\]
Yes, you must include the square brackets, and you have to escape them.
Now fill out your story. There are some differences to Rails' versions. The best places to look for help are in the Merb code itself:
To start you off, here are the steps for a simple integration test:
1 steps_for(:homepage) do
2 When("I visit the root") do
3 @mycontroller = get("/")
4 end
5 Then("I should see the home page") do
6 @mycontroller.should respond_successfully
7 @mycontroller.body.should contain("Hello")
8 end
9 end
As you write your tests, don't trust Merb absolutely. Some things are wrong, don't work, or aren't meant to work [yet]. As part of debugging, look at the Merb source, and fork it and fix it if needed.
The problem is not necessarily in your code.