can you controller context test just one test via the -n flag?
0 views
Skip to first unread message
kenglish
unread,
Oct 9, 2008, 1:54:56 PM10/9/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to shoulda
I have a controller test like this:
class NotificationsControllerTest < ActionController::TestCase
include AuthenticatedTestHelper
context "on GET to :index" do
setup {
login_as :admin
get :index
}
should_assign_to :notifications
should_respond_with :success
should_render_template :index
should_not_set_the_flash
end
context "on GET to :new" do
setup {
login_as :admin
get :new
}
should_respond_with :success
should_render_template :new
should_not_set_the_flash
end
end
In this case, how would I run the single test for the context "on GET
to :new"?
I tried:
ruby test/functional/notifications_controller_test.rb -n "on GET
to :new"
and
ruby test/functional/notifications_controller_test.rb -n "test:on GET
to :new"
Mahalo,
Kevin English
david.l...@gmail.com
unread,
Oct 9, 2008, 2:45:46 PM10/9/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sho...@googlegroups.com
use a regexp... // instead of ""
-D
kenglish
unread,
Oct 9, 2008, 3:07:35 PM10/9/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to shoulda
Wow, that's awesome.
Aloha,
Kevin
david.l...@gmail.com
unread,
Oct 9, 2008, 3:23:23 PM10/9/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sho...@googlegroups.com
PS, if you're using the shoulda textmate bundle, it's option-apple-R to "run focused context"