Created
November 28, 2012 08:22
-
-
Save gamov/4159841 to your computer and use it in GitHub Desktop.
Functional testing a controller with a scoped path?!?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#routes | |
scope :path => 'shipping_reports', :controller => 'ShippingReports', :as => 'shipping_reports' do | |
get 'index' | |
end | |
#test | |
class ShippingReportsControllerTest < ActionController::TestCase | |
test "routing" do | |
assert_routing '/shipping_reports/index', { :controller => "ShippingReports", :action => "index" } | |
end | |
test 'index' do | |
get :index, :controller => 'ShippingReports' | |
assert_response :success | |
end | |
end | |
# first passes, second fails with: | |
#ActionController::RoutingError: No route matches {:controller=>"shipping_reports"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment