So in a flash of inspiration on the airplane last week, I jotted down a new version of my shoulda params pattern. Put this pastie in test/shoulda_macros/request_params.rb
The general idea is this:
a_get_to(:index) do
with_params( {:foo => 'bar'}, "valid params" ) do
should_respond_with :success
with_params( :more => 'nested stuff' ) do
should "do something extra special" do
assert true
end
end
end
end
Here’s what it looks like in action, taken from the ScrumNinja.com code:
require File.dirname(__FILE__) + '/../test_helper'
class MainControllerTest < ActionController::TestCase
@@message = "you guys rock!"
context "When not logged in" do
setup do
login_as( nil )
end
%w[ index tour contact api ].each do |action|
a_get_to( action, params=false ) do
should_respond_with :success
end
end
a_get_to( :feedback, params=false ) do
should_redirect_to "'/login'"
end
a_post_to( :contact, :message => @@message ) do
should_send_email :to => "Mailer::GO_EMAIL", :body => %r{#@@message}
should_redirect_to "'/'"
end
end
context "When logged in" do
setup do
login_as( @user = create_user )
end
a_post_to( :feedback, :message => @@message ) do
should_send_email :to => "Mailer::GO_EMAIL", :body => %r{#@@message}
should_respond_with :redirect
end
end
end
We are proud to announce the alpha of our very first product!
ScrumNinja: a hosted project management tool built from scratch with Scrum in mind.
Here is the message we sent to our announcement list:
We are excited to announce the Alpha version of ScrumNinja. The best way to see the value of this tool is to commit to using it for a real project, even just a small one. ScrumNinja will always be free for one project and up to three users. For now, there are no limits to the number of users or projects. Please check out the quick start guide to get started:
If you’d like to become an official tester and be considered for a $50 credit, please let us know. Official testers actively use the product to manage a real project, give us feedback and occasionally answer simple questionnaires.
Regards, Rodney and David
