Skip to content

Commit

Permalink
Explicity set recognized route for specs where params map to many routes
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwhite committed Sep 18, 2009
1 parent bfa9f69 commit b655ebe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/controllers/tags_controller_via_forum_post_spec.rb
Expand Up @@ -27,6 +27,7 @@ def setup_mocks
@tag.stub!(:to_param).and_return('3')
@post_tags.stub!(:find).and_return(@tag)

@controller.stub!(:recognized_route).and_return(ActionController::Routing::Routes.named_routes[:forum_post_tag])
get :show, :forum_id => "1", :post_id => "2", :id => "3"
end

Expand Down Expand Up @@ -69,6 +70,7 @@ def setup_mocks
@other_post = Post.create :forum_id => @forum.id
@other_tag = Tag.create :taggable_id => @other_post.id, :taggable_type => 'Post'

@controller.stub!(:recognized_route).and_return(ActionController::Routing::Routes.named_routes[:forum_post_tags])
get :index, :forum_id => @forum.id, :post_id => @post.id
@resource_service = controller.send :resource_service
end
Expand Down Expand Up @@ -106,6 +108,7 @@ def setup_mocks
end

def do_get
@controller.stub!(:recognized_route).and_return(ActionController::Routing::Routes.named_routes[:forum_post_tags])
get :index, :forum_id => 1, :post_id => 2
end

Expand Down

0 comments on commit b655ebe

Please sign in to comment.