Skip to content
Browse files

refactored method name prepend_category_view_path => prepend_alternat…

…e_view_path
  • Loading branch information...
1 parent 03b8ccf commit 1ea26befbbeb383a0ca5f5245edd19378a4272dc @matthewrobertson committed Jan 29, 2013
Showing with 6 additions and 6 deletions.
  1. +2 −2 lib/ress/controller_additions.rb
  2. +4 −4 spec/ress/controller_additions_spec.rb
View
4 lib/ress/controller_additions.rb
@@ -6,10 +6,10 @@ module ControllerAdditions
def self.included(base)
base.helper_method :canonical_request?
base.helper_method :force_canonical_url
- base.before_filter :prepend_category_view_path
+ base.before_filter :prepend_alternate_view_path
end
- def prepend_category_view_path
+ def prepend_alternate_view_path
Ress.alternate_versions.each do |cat|
prepend_view_path(cat.view_path) if cat.matches?(request.subdomain)
end
View
8 spec/ress/controller_additions_spec.rb
@@ -23,10 +23,10 @@ def self.helper_method(*splat) ; end
describe Ress::ControllerAdditions do
it 'adds a before_filter to all actions when it is included' do
- ActionControllerStub.action.should == :prepend_category_view_path
+ ActionControllerStub.action.should == :prepend_alternate_view_path
end
- describe '#prepend_category_view_path' do
+ describe '#prepend_alternate_view_path' do
let(:controller) { ActionControllerStub.new }
@@ -40,15 +40,15 @@ def self.helper_method(*splat) ; end
Ress.stub(:alternate_versions => [category])
controller.should_receive(:prepend_view_path).with('foo/bar')
- controller.prepend_category_view_path
+ controller.prepend_alternate_view_path
end
it 'does not prepend view paths of alternate_versions that dont match' do
category = stub('category', :matches? => false, :view_path => 'foo/bar')
Ress.stub(:alternate_versions => [category])
controller.should_not_receive(:prepend_view_path)
- controller.prepend_category_view_path
+ controller.prepend_alternate_view_path
end
end

0 comments on commit 1ea26be

Please sign in to comment.
Something went wrong with that request. Please try again.