Skip to content

Commit

Permalink
Updated spec for new namespace_segments API
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwhite committed Jan 29, 2010
1 parent 0f8f5f2 commit 21e18a3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spec/lib/request_path_introspection_spec.rb
Expand Up @@ -61,9 +61,14 @@ class User < ActiveRecord::Base; end
end
end

it "#namespace_segments should return namespace segments if present in request_path" do
it "#namespace_segments should return [] segments if NOT present in request_path" do
@controller.stub!(:controller_path).and_return('some/name/space/forums')
@controller.stub!(:request_path).and_return('/SAM/name/space/users/1/secret/forums')
@controller.send(:namespace_segments).should == []
end

it "#namespace_segments should return namespace segments if present in request_path" do
@controller.stub!(:controller_path).and_return('some/name/space/forums')
@controller.stub!(:request_path).and_return('/some/name/space/users/1/secret/forums')
@controller.send(:namespace_segments).should == ['some', 'name', 'space']
end
Expand Down

0 comments on commit 21e18a3

Please sign in to comment.