public
Description: Set of protected methods that use the subdomain as a way of identifying the current scope
Homepage:
Clone URL: git://github.com/jfernandez/submarine.git
submarine / spec / submarine / submarine_spec.rb
b3853cb0 » jfernandez 2008-06-02 Initial refactoring for rspec 1 require File.dirname(__FILE__) + '/../spec_helper'
2 require 'spec'
3
4 module Submarine
5 class UsersController < ActionController::Base
6 include Submarine
7 public :current_subdomain, :default_submarine_subdomain
8
9 def index() render :nothing => true end
10 alias_method :show, :index
11 def rescue_action(e) raise end
12 end
13
14 class BlogsController < ActionController::Base
15 include Submarine
16 public :current_subdomain, :default_submarine_subdomain
17
18 def subdomain_model; 'blog' end
19 def subdomain_column; 'name' end
20 def index() render :nothing => true end
21 alias_method :show, :index
22 def rescue_action(e) raise end
23 end
24 end
25
26 describe Submarine::UsersController, :type => :controller do
27 controller_name :users_controller
28
29 it "should respond to #current_subdomain" do
30 get 'index'
31 end
32 end