spud_core 0.8.21 → 0.8.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/controllers/spud/application_controller.rb +1 -14
- data/app/helpers/spud/application_helper.rb +15 -0
- data/lib/spud_core/version.rb +1 -1
- data/spec/controllers/spud/application_controller_spec.rb +1 -68
- data/spec/dummy/log/test.log +10146 -0
- data/spec/helpers/spud/application_helper_spec.rb +62 -0
- metadata +7 -4
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Spud::ApplicationHelper do
|
|
4
|
+
before :each do
|
|
5
|
+
activate_authlogic
|
|
6
|
+
@user = FactoryGirl.create(:spud_user)
|
|
7
|
+
@session = SpudUserSession.create(@user)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
describe :current_site_name do
|
|
11
|
+
|
|
12
|
+
it "should return config site name if multisite is disabled" do
|
|
13
|
+
Spud::Core.configure do |config|
|
|
14
|
+
config.site_name = "Test Site"
|
|
15
|
+
end
|
|
16
|
+
helper.current_site_name.should == 'Test Site'
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it "should return config site name if multisite is enabled but multisite name is blank" do
|
|
20
|
+
Spud::Core.configure do |config|
|
|
21
|
+
config.site_name = "Test Site"
|
|
22
|
+
config.multisite_mode_enabled = true
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
helper.current_site_name.should == 'Test Site'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it "should return multisite name if multisite is enabled" do
|
|
29
|
+
Spud::Core.configure do |config|
|
|
30
|
+
config.site_name = "Test Site"
|
|
31
|
+
config.multisite_mode_enabled = true
|
|
32
|
+
config.multisite_config += [{:hosts => ["test.host"], :site_name =>"Site B", :site_id => 1}]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
helper.current_site_name.should == 'Site B'
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
describe :current_site_id do
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
it "should return the default site id if multisite is disabled" do
|
|
44
|
+
Spud::Core.configure do |config|
|
|
45
|
+
config.site_id = 0
|
|
46
|
+
config.multisite_mode_enabled = false
|
|
47
|
+
config.multisite_config = []
|
|
48
|
+
end
|
|
49
|
+
helper.current_site_id.should == 0
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
it "should return the current site id if multisite is enabled" do
|
|
53
|
+
Spud::Core.configure do |config|
|
|
54
|
+
config.multisite_mode_enabled = true
|
|
55
|
+
config.multisite_config = [{:hosts => ["test.host"], :site_name =>"Site B", :site_id => 1}]
|
|
56
|
+
end
|
|
57
|
+
# @controller.request = request
|
|
58
|
+
helper.current_site_id.should == 1
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
end
|
|
62
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spud_core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.22
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2012-08-
|
|
12
|
+
date: 2012-08-09 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|
|
@@ -576,6 +576,7 @@ files:
|
|
|
576
576
|
- app/controllers/spud/user_sessions_controller.rb
|
|
577
577
|
- app/controllers/spud/users_controller.rb
|
|
578
578
|
- app/helpers/spud/admin/application_helper.rb
|
|
579
|
+
- app/helpers/spud/application_helper.rb
|
|
579
580
|
- app/helpers/spud/password_resets_helper.rb
|
|
580
581
|
- app/mailers/spud/core_mailer.rb
|
|
581
582
|
- app/models/spud_admin_permission.rb
|
|
@@ -661,6 +662,7 @@ files:
|
|
|
661
662
|
- spec/dummy/README.rdoc
|
|
662
663
|
- spec/dummy/script/rails
|
|
663
664
|
- spec/helpers/spud/admin/application_helper_spec.rb
|
|
665
|
+
- spec/helpers/spud/application_helper_spec.rb
|
|
664
666
|
- spec/lib/spud_core/configuration_spec.rb
|
|
665
667
|
- spec/models/spud_user_spec.rb
|
|
666
668
|
- spec/spec_helper.rb
|
|
@@ -679,7 +681,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
679
681
|
version: '0'
|
|
680
682
|
segments:
|
|
681
683
|
- 0
|
|
682
|
-
hash: -
|
|
684
|
+
hash: -1638917848020665640
|
|
683
685
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
684
686
|
none: false
|
|
685
687
|
requirements:
|
|
@@ -688,7 +690,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
688
690
|
version: '0'
|
|
689
691
|
segments:
|
|
690
692
|
- 0
|
|
691
|
-
hash: -
|
|
693
|
+
hash: -1638917848020665640
|
|
692
694
|
requirements: []
|
|
693
695
|
rubyforge_project:
|
|
694
696
|
rubygems_version: 1.8.24
|
|
@@ -737,6 +739,7 @@ test_files:
|
|
|
737
739
|
- spec/dummy/README.rdoc
|
|
738
740
|
- spec/dummy/script/rails
|
|
739
741
|
- spec/helpers/spud/admin/application_helper_spec.rb
|
|
742
|
+
- spec/helpers/spud/application_helper_spec.rb
|
|
740
743
|
- spec/lib/spud_core/configuration_spec.rb
|
|
741
744
|
- spec/models/spud_user_spec.rb
|
|
742
745
|
- spec/spec_helper.rb
|