Skip to content

controller_path sometimes empty #316

@rwestgeest

Description

@rwestgeest

controller.controller_path is inferred from the rendered template.
This spec

    describe "table/some_action", :focus => true do
      it "should have an input in the form" do
        render :template => 'table/some_action'
        controller_path.should == 'table' 
      end
    end

passes, while this spec

    describe "table views" do
      describe "table/some_action", :focus => true do
        it "should have an input in the form" do
          render :template => 'table/some_action'
          controller_path.should == 'table'
        end
      end
    end

fails as controller_path is empty.

I think it would be fair to expect that wrapping such an example group in another should not break the spec.

This took me a while to figure out. I did not realize that controller path was used for

    url_for(:action => 'x') 

and

    render(:partial => 'y') 

Just saw strange errors indicating that there was something wrong with my controller in some (actually a lot but not all) of my view specs.

Cheers
Rob

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions