Commit 088c792e86414670f5dad67dad6def42add07acc

Authored by Braulio Bhavamitra
2 parents 918d7d3b e22aa922

Merge branch 'case-insensitive-profile' into noosfero

app/controllers/my_profile/enterprise_validation_controller.rb
1 class EnterpriseValidationController < MyProfileController 1 class EnterpriseValidationController < MyProfileController
2 2
3 protect 'validate_enterprise', :profile 3 protect 'validate_enterprise', :profile
4 - 4 +
5 def index 5 def index
6 @pending_validations = profile.pending_validations 6 @pending_validations = profile.pending_validations
7 end 7 end
@@ -27,7 +27,7 @@ class EnterpriseValidationController &lt; MyProfileController @@ -27,7 +27,7 @@ class EnterpriseValidationController &lt; MyProfileController
27 post_only :reject 27 post_only :reject
28 def reject 28 def reject
29 @pending = profile.find_pending_validation(params[:id]) 29 @pending = profile.find_pending_validation(params[:id])
30 - if @pending 30 + if @pending
31 @pending.reject_explanation = params[:reject_explanation] 31 @pending.reject_explanation = params[:reject_explanation]
32 begin 32 begin
33 @pending.reject 33 @pending.reject
app/models/validation_info.rb
@@ -2,9 +2,10 @@ class ValidationInfo &lt; ActiveRecord::Base @@ -2,9 +2,10 @@ class ValidationInfo &lt; ActiveRecord::Base
2 2
3 attr_accessible :validation_methodology, :restrictions, :organization 3 attr_accessible :validation_methodology, :restrictions, :organization
4 4
5 - validates_presence_of :validation_methodology  
6 -  
7 belongs_to :organization 5 belongs_to :organization
8 6
  7 + validates_presence_of :organization
  8 + validates_presence_of :validation_methodology
  9 +
9 xss_terminate :only => [ :validation_methodology, :restrictions ], :on => 'validation' 10 xss_terminate :only => [ :validation_methodology, :restrictions ], :on => 'validation'
10 end 11 end
config/routes.rb
@@ -56,37 +56,37 @@ Noosfero::Application.routes.draw do @@ -56,37 +56,37 @@ Noosfero::Application.routes.draw do
56 match 'search(/:action(/*category_path))', :controller => 'search' 56 match 'search(/:action(/*category_path))', :controller => 'search'
57 57
58 # events 58 # events
59 - match 'profile/:profile/events_by_day', :controller => 'events', :action => 'events_by_day', :profile => /#{Noosfero.identifier_format_in_url}/  
60 - match 'profile/:profile/events_by_month', :controller => 'events', :action => 'events_by_month', :profile => /#{Noosfero.identifier_format_in_url}/  
61 - match 'profile/:profile/events/:year/:month/:day', :controller => 'events', :action => 'events', :year => /\d*/, :month => /\d*/, :day => /\d*/, :profile => /#{Noosfero.identifier_format_in_url}/  
62 - match 'profile/:profile/events/:year/:month', :controller => 'events', :action => 'events', :year => /\d*/, :month => /\d*/, :profile => /#{Noosfero.identifier_format_in_url}/  
63 - match 'profile/:profile/events', :controller => 'events', :action => 'events', :profile => /#{Noosfero.identifier_format_in_url}/ 59 + match 'profile/:profile/events_by_day', :controller => 'events', :action => 'events_by_day', :profile => /#{Noosfero.identifier_format_in_url}/i
  60 + match 'profile/:profile/events_by_month', :controller => 'events', :action => 'events_by_month', :profile => /#{Noosfero.identifier_format_in_url}/i
  61 + match 'profile/:profile/events/:year/:month/:day', :controller => 'events', :action => 'events', :year => /\d*/, :month => /\d*/, :day => /\d*/, :profile => /#{Noosfero.identifier_format_in_url}/i
  62 + match 'profile/:profile/events/:year/:month', :controller => 'events', :action => 'events', :year => /\d*/, :month => /\d*/, :profile => /#{Noosfero.identifier_format_in_url}/i
  63 + match 'profile/:profile/events', :controller => 'events', :action => 'events', :profile => /#{Noosfero.identifier_format_in_url}/i
64 64
65 # catalog 65 # catalog
66 - match 'catalog/:profile', :controller => 'catalog', :action => 'index', :profile => /#{Noosfero.identifier_format_in_url}/, :as => :catalog 66 + match 'catalog/:profile', :controller => 'catalog', :action => 'index', :profile => /#{Noosfero.identifier_format_in_url}/i, :as => :catalog
67 67
68 # invite 68 # invite
69 - match 'profile/:profile/invite/friends', :controller => 'invite', :action => 'invite_friends', :profile => /#{Noosfero.identifier_format_in_url}/  
70 - match 'profile/:profile/invite/:action', :controller => 'invite', :profile => /#{Noosfero.identifier_format_in_url}/ 69 + match 'profile/:profile/invite/friends', :controller => 'invite', :action => 'invite_friends', :profile => /#{Noosfero.identifier_format_in_url}/i
  70 + match 'profile/:profile/invite/:action', :controller => 'invite', :profile => /#{Noosfero.identifier_format_in_url}/i
71 71
72 # feeds per tag 72 # feeds per tag
73 - match 'profile/:profile/tags/:id/feed', :controller => 'profile', :action =>'tag_feed', :id => /.+/, :profile => /#{Noosfero.identifier_format_in_url}/, :as => :tag_feed 73 + match 'profile/:profile/tags/:id/feed', :controller => 'profile', :action =>'tag_feed', :id => /.+/, :profile => /#{Noosfero.identifier_format_in_url}/i, :as => :tag_feed
74 74
75 # profile tags 75 # profile tags
76 - match 'profile/:profile/tags/:id', :controller => 'profile', :action => 'content_tagged', :id => /.+/, :profile => /#{Noosfero.identifier_format_in_url}/  
77 - match 'profile/:profile/tags(/:id)', :controller => 'profile', :action => 'tags', :profile => /#{Noosfero.identifier_format_in_url}/ 76 + match 'profile/:profile/tags/:id', :controller => 'profile', :action => 'content_tagged', :id => /.+/, :profile => /#{Noosfero.identifier_format_in_url}/i
  77 + match 'profile/:profile/tags(/:id)', :controller => 'profile', :action => 'tags', :profile => /#{Noosfero.identifier_format_in_url}/i
78 78
79 # profile search 79 # profile search
80 - match 'profile/:profile/search', :controller => 'profile_search', :action => 'index', :profile => /#{Noosfero.identifier_format_in_url}/ 80 + match 'profile/:profile/search', :controller => 'profile_search', :action => 'index', :profile => /#{Noosfero.identifier_format_in_url}/i
81 81
82 # comments 82 # comments
83 - match 'profile/:profile/comment/:action/:id', :controller => 'comment', :profile => /#{Noosfero.identifier_format_in_url}/ 83 + match 'profile/:profile/comment/:action/:id', :controller => 'comment', :profile => /#{Noosfero.identifier_format_in_url}/i
84 84
85 # public profile information 85 # public profile information
86 - match 'profile/:profile(/:action(/:id))', :controller => 'profile', :action => 'index', :id => /[^\/]*/, :profile => /#{Noosfero.identifier_format_in_url}/, :as => :profile 86 + match 'profile/:profile(/:action(/:id))', :controller => 'profile', :action => 'index', :id => /[^\/]*/, :profile => /#{Noosfero.identifier_format_in_url}/i, :as => :profile
87 87
88 # contact 88 # contact
89 - match 'contact/:profile/:action(/:id)', :controller => 'contact', :action => 'index', :id => /.*/, :profile => /#{Noosfero.identifier_format_in_url}/ 89 + match 'contact/:profile/:action(/:id)', :controller => 'contact', :action => 'index', :id => /.*/, :profile => /#{Noosfero.identifier_format_in_url}/i
90 90
91 # map balloon 91 # map balloon
92 match 'map_balloon/:action/:id', :controller => 'map_balloon', :id => /.*/ 92 match 'map_balloon/:action/:id', :controller => 'map_balloon', :id => /.*/
@@ -98,8 +98,8 @@ Noosfero::Application.routes.draw do @@ -98,8 +98,8 @@ Noosfero::Application.routes.draw do
98 ## Controllers that are profile-specific (for profile admins ) 98 ## Controllers that are profile-specific (for profile admins )
99 ###################################################### 99 ######################################################
100 # profile customization - "My profile" 100 # profile customization - "My profile"
101 - match 'myprofile/:profile', :controller => 'profile_editor', :action => 'index', :profile => /#{Noosfero.identifier_format_in_url}/  
102 - match 'myprofile/:profile/:controller(/:action(/:id))', :controller => Noosfero.pattern_for_controllers_in_directory('my_profile'), :profile => /#{Noosfero.identifier_format_in_url}/, :as => :myprofile 101 + match 'myprofile/:profile', :controller => 'profile_editor', :action => 'index', :profile => /#{Noosfero.identifier_format_in_url}/i
  102 + match 'myprofile/:profile/:controller(/:action(/:id))', :controller => Noosfero.pattern_for_controllers_in_directory('my_profile'), :profile => /#{Noosfero.identifier_format_in_url}/i, :as => :myprofile
103 103
104 104
105 ###################################################### 105 ######################################################
@@ -127,14 +127,14 @@ Noosfero::Application.routes.draw do @@ -127,14 +127,14 @@ Noosfero::Application.routes.draw do
127 # cache stuff - hack 127 # cache stuff - hack
128 match 'public/:action/:id', :controller => 'public' 128 match 'public/:action/:id', :controller => 'public'
129 129
130 - match ':profile/*page/versions', :controller => 'content_viewer', :action => 'article_versions', :profile => /#{Noosfero.identifier_format_in_url}/, :constraints => EnvironmentDomainConstraint.new 130 + match ':profile/*page/versions', :controller => 'content_viewer', :action => 'article_versions', :profile => /#{Noosfero.identifier_format_in_url}/i, :constraints => EnvironmentDomainConstraint.new
131 match '*page/versions', :controller => 'content_viewer', :action => 'article_versions' 131 match '*page/versions', :controller => 'content_viewer', :action => 'article_versions'
132 132
133 - match ':profile/*page/versions_diff', :controller => 'content_viewer', :action => 'versions_diff', :profile => /#{Noosfero.identifier_format_in_url}/, :constraints => EnvironmentDomainConstraint.new 133 + match ':profile/*page/versions_diff', :controller => 'content_viewer', :action => 'versions_diff', :profile => /#{Noosfero.identifier_format_in_url}/i, :constraints => EnvironmentDomainConstraint.new
134 match '*page/versions_diff', :controller => 'content_viewer', :action => 'versions_diff' 134 match '*page/versions_diff', :controller => 'content_viewer', :action => 'versions_diff'
135 135
136 # match requests for profiles that don't have a custom domain 136 # match requests for profiles that don't have a custom domain
137 - match ':profile(/*page)', :controller => 'content_viewer', :action => 'view_page', :profile => /#{Noosfero.identifier_format_in_url}/, :constraints => EnvironmentDomainConstraint.new 137 + match ':profile(/*page)', :controller => 'content_viewer', :action => 'view_page', :profile => /#{Noosfero.identifier_format_in_url}/i, :constraints => EnvironmentDomainConstraint.new
138 138
139 # match requests for content in domains hosted for profiles 139 # match requests for content in domains hosted for profiles
140 match '/(*page)', :controller => 'content_viewer', :action => 'view_page' 140 match '/(*page)', :controller => 'content_viewer', :action => 'view_page'
lib/needs_profile.rb
@@ -21,7 +21,11 @@ module NeedsProfile @@ -21,7 +21,11 @@ module NeedsProfile
21 protected 21 protected
22 22
23 def load_profile 23 def load_profile
24 - @profile ||= environment.profiles.find_by_identifier(params[:profile]) 24 + if params[:profile]
  25 + params[:profile].downcase!
  26 + @profile ||= environment.profiles.where(identifier: params[:profile]).first
  27 + end
  28 +
25 if @profile 29 if @profile
26 profile_hostname = @profile.hostname 30 profile_hostname = @profile.hostname
27 if profile_hostname && profile_hostname != request.host 31 if profile_hostname && profile_hostname != request.host
lib/noosfero/plugin/routes.rb
@@ -19,15 +19,15 @@ Dir.glob(Rails.root.join(plugins_root, &#39;*&#39;, &#39;controllers&#39;)) do |controllers_dir| @@ -19,15 +19,15 @@ Dir.glob(Rails.root.join(plugins_root, &#39;*&#39;, &#39;controllers&#39;)) do |controllers_dir|
19 controllers.each do |controller| 19 controllers.each do |controller|
20 controller_name = controller.gsub("#{plugin_name}_plugin_",'') 20 controller_name = controller.gsub("#{plugin_name}_plugin_",'')
21 if %w[profile myprofile].include?(folder.to_s) 21 if %w[profile myprofile].include?(folder.to_s)
22 - match "#{prefixes_by_folder[folder]}/#{plugin_name}/#{controller_name}(/:action(/:id))", :controller => controller, :profile => /#{Noosfero.identifier_format}/ 22 + match "#{prefixes_by_folder[folder]}/#{plugin_name}/#{controller_name}(/:action(/:id))", controller: controller, profile: /#{Noosfero.identifier_format_in_url}/i
23 else 23 else
24 - match "#{prefixes_by_folder[folder]}/#{plugin_name}/#{controller_name}(/:action(/:id))", :controller => controller 24 + match "#{prefixes_by_folder[folder]}/#{plugin_name}/#{controller_name}(/:action(/:id))", controller: controller
25 end 25 end
26 end 26 end
27 end 27 end
28 28
29 - match 'plugin/' + plugin_name + '(/:action(/:id))', :controller => plugin_name + '_plugin'  
30 - match 'profile/:profile/plugin/' + plugin_name + '(/:action(/:id))', :controller => plugin_name + '_plugin_profile', :profile => /#{Noosfero.identifier_format}/  
31 - match 'myprofile/:profile/plugin/' + plugin_name + '(/:action(/:id))', :controller => plugin_name + '_plugin_myprofile', :profile => /#{Noosfero.identifier_format}/  
32 - match 'admin/plugin/' + plugin_name + '(/:action(/:id))', :controller => plugin_name + '_plugin_admin' 29 + match 'plugin/' + plugin_name + '(/:action(/:id))', controller: plugin_name + '_plugin'
  30 + match 'profile/:profile/plugin/' + plugin_name + '(/:action(/:id))', controller: plugin_name + '_plugin_profile', profile: /#{Noosfero.identifier_format_in_url}/i
  31 + match 'myprofile/:profile/plugin/' + plugin_name + '(/:action(/:id))', controller: plugin_name + '_plugin_myprofile', profile: /#{Noosfero.identifier_format_in_url}/i
  32 + match 'admin/plugin/' + plugin_name + '(/:action(/:id))', controller: plugin_name + '_plugin_admin'
33 end 33 end
test/functional/enterprise_validation_controller_test.rb
@@ -12,126 +12,109 @@ class EnterpriseValidationControllerTest &lt; ActionController::TestCase @@ -12,126 +12,109 @@ class EnterpriseValidationControllerTest &lt; ActionController::TestCase
12 @controller = EnterpriseValidationController.new 12 @controller = EnterpriseValidationController.new
13 @request = ActionController::TestRequest.new 13 @request = ActionController::TestRequest.new
14 @response = ActionController::TestResponse.new 14 @response = ActionController::TestResponse.new
15 - 15 +
16 login_as 'ze' 16 login_as 'ze'
17 - @org = Organization.create!(:identifier => 'myorg', :name => "My Org") 17 + @user = Profile['ze']
  18 + @org = Organization.create!(identifier: 'myorg', name: "My Org")
18 give_permission('ze', 'validate_enterprise', @org) 19 give_permission('ze', 'validate_enterprise', @org)
19 - Profile.expects(:find_by_identifier).with('myorg').returns(@org).at_least_once  
20 end 20 end
21 21
22 should 'list pending validations on index' do 22 should 'list pending validations on index' do
23 - empty = []  
24 - @org.expects(:pending_validations).returns(empty)  
25 - get :index, :profile => 'myorg'  
26 - assert_equal empty, assigns(:pending_validations) 23 + get :index, profile: 'myorg'
  24 + assert_equal [], assigns(:pending_validations)
27 assert_template 'index' 25 assert_template 'index'
28 end 26 end
29 27
30 should 'display details and prompt for needed data when approving or rejecting enterprise' do 28 should 'display details and prompt for needed data when approving or rejecting enterprise' do
31 - validating = CreateEnterprise.new  
32 - @org.expects(:find_pending_validation).with('kakakaka').returns(validating)  
33 -  
34 - get :details, :profile => 'myorg', :id => 'kakakaka'  
35 - assert_same validating, assigns(:pending) 29 + code = 'kakakaka'
  30 + @org.validations.create! code: code, name: 'test', identifier: 'test', requestor: @user, target: @org
  31 + get :details, profile: 'myorg', id: code
  32 + assert_equal @org.find_pending_validation(code), assigns(:pending)
36 end 33 end
37 34
38 should 'refuse to validate unexisting request' do 35 should 'refuse to validate unexisting request' do
39 - @org.expects(:find_pending_validation).with('kakakaka').returns(nil)  
40 - get :details , :profile => 'myorg', :id => 'kakakaka' 36 + get :details, profile: 'myorg', id: 'kakakaka'
41 assert_response 404 37 assert_response 404
42 end 38 end
43 39
44 should 'be able to actually validate enterprise on request' do 40 should 'be able to actually validate enterprise on request' do
45 - validation = CreateEnterprise.new  
46 - @org.expects(:find_pending_validation).with('kakakaka').returns(validation)  
47 - validation.expects(:approve)  
48 - validation.expects(:code).returns('kakakaka')  
49 - post :approve, :profile => 'myorg', :id => 'kakakaka'  
50 - assert_redirected_to :action => 'view_processed', :id => 'kakakaka' 41 + code = 'kakakaka'
  42 + @org.validations.create! code: code, name: 'test2', identifier: 'test2', requestor: @user, target: @org
  43 + post :approve, profile: 'myorg', id: code
  44 + assert_redirected_to action: 'view_processed', id: code
51 end 45 end
52 46
53 should 'be able to reject an enterprise' do 47 should 'be able to reject an enterprise' do
54 - validation = CreateEnterprise.new  
55 - @org.expects(:find_pending_validation).with('kakakaka').returns(validation)  
56 - validation.expects(:reject)  
57 - validation.expects(:code).returns('kakakaka')  
58 - post :reject, :profile => 'myorg', :id => 'kakakaka', :reject_explanation => 'this is not a solidarity economy enterprise'  
59 - assert_redirected_to :action => 'view_processed', :id => 'kakakaka' 48 + code = 'kakakaka'
  49 + @org.validations.create! code: code, name: 'test2', identifier: 'test2', requestor: @user, target: @org
  50 + post :reject, profile: 'myorg', id: code, reject_explanation: 'this is not a solidarity economy enterprise'
  51 + assert_redirected_to action: 'view_processed', id: code
60 end 52 end
61 53
62 should 'require the user to fill in the explanation for an rejection' do 54 should 'require the user to fill in the explanation for an rejection' do
63 - validation = CreateEnterprise.new  
64 - validation.stubs(:environment).returns(Environment.default)  
65 - @org.expects(:find_pending_validation).with('kakakaka').returns(validation)  
66 -  
67 - # FIXME: this is not working, but should. Anyway the assert_response and  
68 - # assert_template below in some test some things we need. But the  
69 - # expectation below must be put to work.  
70 - #  
71 - #validation.expects(:reject).raises(ActiveRecord::RecordInvalid) 55 + code = 'kakakaka'
  56 + @org.validations.create! code: code, name: 'test2', identifier: 'test2', requestor: @user, target: @org
72 57
73 - post :reject, :profile => 'myorg', :id => 'kakakaka' 58 + post :reject, profile: 'myorg', id: code
74 assert_response :success 59 assert_response :success
75 assert_template 'details' 60 assert_template 'details'
76 end 61 end
77 62
78 should 'list validations already processed' do 63 should 'list validations already processed' do
79 - processed_validations = [CreateEnterprise.new]  
80 - @org.expects(:processed_validations).returns(processed_validations)  
81 -  
82 - get :list_processed, :profile => 'myorg' 64 + v = @org.validations.create! code: 'kakakaka', name: 'test2', identifier: 'test2', requestor: @user, target: @org
  65 + v.perform
83 66
84 - assert_equal processed_validations, assigns(:processed_validations) 67 + get :list_processed, profile: 'myorg'
  68 +
  69 + assert_equal @org.processed_validations, assigns(:processed_validations)
85 70
86 assert_response :success 71 assert_response :success
87 assert_template 'list_processed' 72 assert_template 'list_processed'
88 end 73 end
89 - 74 +
90 should 'be able to display a validation that was already processed' do 75 should 'be able to display a validation that was already processed' do
91 - validation = CreateEnterprise.new  
92 - @org.expects(:find_processed_validation).with('kakakaka').returns(validation)  
93 - get :view_processed, :profile => 'myorg', :id => 'kakakaka'  
94 - assert_same validation, assigns(:processed) 76 + code = 'kakakaka'
  77 + v = @org.validations.create! code: code, name: 'test2', identifier: 'test2', requestor: @user, target: @org
  78 + v.perform
  79 +
  80 + get :view_processed, profile: 'myorg', id: code
  81 + assert_same @org.processed_validations.first, assigns(:processed)
95 end 82 end
96 83
97 should 'display a form for editing the validation info' do 84 should 'display a form for editing the validation info' do
98 - info = ValidationInfo.new(:validation_methodology => 'none')  
99 - @org.expects(:validation_info).returns(info)  
100 - get :edit_validation_info, :profile => 'myorg' 85 + info = @org.validation_info = ValidationInfo.create! validation_methodology: 'none', organization: @org
  86 + get :edit_validation_info, profile: 'myorg'
101 assert_response :success 87 assert_response :success
102 assert_equal info, assigns(:info) 88 assert_equal info, assigns(:info)
103 end 89 end
104 90
105 should 'save an alteration of the validation info' do 91 should 'save an alteration of the validation info' do
106 - info = ValidationInfo.new(:validation_methodology => 'none')  
107 - @org.expects(:validation_info).returns(info)  
108 - post :edit_validation_info, :profile => 'myorg', :info => {:validation_methodology => 'new methodology'}  
109 - 92 + info = @org.validation_info = ValidationInfo.create! validation_methodology: 'none', organization: @org
  93 + post :edit_validation_info, profile: 'myorg', info: {validation_methodology: 'new methodology'}
  94 +
110 assert_response :redirect 95 assert_response :redirect
111 - assert_redirected_to :action => 'index'  
112 - assert_equal info, assigns(:info) 96 + assert_redirected_to action: 'index'
  97 + info.reload
  98 + assert_equal info.reload, assigns(:info)
113 end 99 end
114 100
115 should 'not save an empaty validation mthodology' do 101 should 'not save an empaty validation mthodology' do
116 - info = ValidationInfo.new(:validation_methodology => 'none')  
117 - @org.expects(:validation_info).returns(info)  
118 - post :edit_validation_info, :profile => 'myorg', :info => {:validation_methodology => ''}  
119 - 102 + info = @org.validation_info = ValidationInfo.create! validation_methodology: 'none', organization: @org
  103 + post :edit_validation_info, profile: 'myorg', info: {validation_methodology: ''}
  104 +
120 assert_response :success 105 assert_response :success
121 assert_equal info, assigns(:info) 106 assert_equal info, assigns(:info)
122 end 107 end
123 108
124 should 'filter html from methodology of the validation info' do 109 should 'filter html from methodology of the validation info' do
125 - info = ValidationInfo.new(:validation_methodology => 'none')  
126 - @org.expects(:validation_info).returns(info)  
127 - post :edit_validation_info, :profile => 'myorg', :info => {:validation_methodology => 'new <b>methodology</b>'} 110 + @org.validation_info = ValidationInfo.create! validation_methodology: 'none', organization: @org
  111 + post :edit_validation_info, profile: 'myorg', info: {validation_methodology: 'new <b>methodology</b>'}
128 assert_sanitized assigns(:info).validation_methodology 112 assert_sanitized assigns(:info).validation_methodology
129 end 113 end
130 114
131 should 'filter html from restrictions of the validation info' do 115 should 'filter html from restrictions of the validation info' do
132 - info = ValidationInfo.new(:validation_methodology => 'none')  
133 - @org.expects(:validation_info).returns(info)  
134 - post :edit_validation_info, :profile => 'myorg', :info => {:restrictions => 'new <b>methodology</b>'} 116 + @org.validation_info = ValidationInfo.create! validation_methodology: 'none', organization: @org
  117 + post :edit_validation_info, profile: 'myorg', info: {restrictions: 'new <b>methodology</b>'}
135 assert_sanitized assigns(:info).restrictions 118 assert_sanitized assigns(:info).restrictions
136 end 119 end
137 120
test/integration/routing_test.rb
@@ -27,6 +27,10 @@ class RoutingTest &lt; ActionController::IntegrationTest @@ -27,6 +27,10 @@ class RoutingTest &lt; ActionController::IntegrationTest
27 assert_routing('/account/new_password/90dfhga7sadgd0as6saas', :controller => 'account', :action => 'new_password', :code => '90dfhga7sadgd0as6saas') 27 assert_routing('/account/new_password/90dfhga7sadgd0as6saas', :controller => 'account', :action => 'new_password', :code => '90dfhga7sadgd0as6saas')
28 end 28 end
29 29
  30 + should 'ignore case for profiles' do
  31 + assert_routing '/myprofile/ZE/cms', profile: 'ZE', controller: 'cms', action: 'index'
  32 + end
  33 +
30 def test_cms 34 def test_cms
31 assert_routing('/myprofile/ze/cms', :profile => 'ze', :controller => 'cms', :action => 'index') 35 assert_routing('/myprofile/ze/cms', :profile => 'ze', :controller => 'cms', :action => 'index')
32 end 36 end