sitepress-rails 0.1.22 → 0.1.23
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.
- checksums.yaml +4 -4
- data/lib/sitepress/engine.rb +12 -3
- data/lib/sitepress/rails_configuration.rb +4 -2
- data/lib/sitepress/route_constraint.rb +3 -3
- data/spec/dummy/log/production.log +56 -0
- data/spec/dummy/log/test.log +28435 -0
- data/spec/sitepress/rails_configuration_spec.rb +2 -21
- data/spec/sitepress-rails_spec.rb +41 -18
- data/spec/spec_helper.rb +3 -1
- metadata +18 -5
@@ -1,24 +1,5 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
describe Sitepress
|
4
|
-
|
5
|
-
context "#partials" do
|
6
|
-
it "excludes partials" do
|
7
|
-
expect(subject.site.resources.size).to eql(2)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
context "#cache_resources" do
|
11
|
-
context "Rails.configuration.cache_classes=true" do
|
12
|
-
before { Rails.configuration.cache_classes = true }
|
13
|
-
it "is true" do
|
14
|
-
expect(subject.cache_resources).to eql(true)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
context "Rails.configuration.cache_classes=false" do
|
18
|
-
before { Rails.configuration.cache_classes = false }
|
19
|
-
it "is false" do
|
20
|
-
expect(subject.cache_resources).to eql(false)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
3
|
+
describe "Sitepress.configuration" do
|
4
|
+
# Tested in sitepress-rails
|
24
5
|
end
|
@@ -1,36 +1,59 @@
|
|
1
1
|
require "spec_helper"
|
2
|
-
require "rails"
|
3
2
|
require "sitepress-rails"
|
4
3
|
|
5
|
-
describe Sitepress do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
4
|
+
describe "Sitepress.configuration" do
|
5
|
+
subject { Sitepress.configuration }
|
6
|
+
let(:app) { Dummy::Application.new }
|
7
|
+
let(:cache_classes) { true }
|
8
|
+
before do
|
9
|
+
app.config.eager_load = cache_classes # WTF?
|
10
|
+
app.config.cache_classes = cache_classes # This is what I really want to test.
|
11
|
+
app.initialize!
|
12
|
+
end
|
13
|
+
it "has site" do
|
14
|
+
expect(subject.site.root_path).to eql(app.root.join("app/content"))
|
15
|
+
end
|
16
|
+
it "has Rails.application as parent engine" do
|
17
|
+
expect(subject.parent_engine).to eql(app)
|
18
|
+
end
|
19
|
+
it "has Rails.application as parent engine" do
|
20
|
+
expect(subject.cache_resources).to be true
|
21
|
+
end
|
22
|
+
it "has routes enabled by default" do
|
23
|
+
expect(subject.routes).to be true
|
24
|
+
end
|
25
|
+
context "#cache_resources" do
|
26
|
+
context "Rails.configuration.cache_classes=true" do
|
27
|
+
let(:cache_classes) { true }
|
28
|
+
it "is true" do
|
29
|
+
expect(subject.cache_resources).to eql(true)
|
30
|
+
end
|
16
31
|
end
|
17
|
-
|
18
|
-
|
32
|
+
context "Rails.configuration.cache_classes=false" do
|
33
|
+
let(:cache_classes) { false }
|
34
|
+
it "is false" do
|
35
|
+
expect(subject.cache_resources).to eql(false)
|
36
|
+
end
|
19
37
|
end
|
20
38
|
end
|
21
39
|
context "Rails.configuration.paths" do
|
22
40
|
subject { Rails.configuration.paths[path].to_a }
|
23
41
|
context "views" do
|
24
42
|
let(:path) { "app/views" }
|
25
|
-
it { should include(
|
43
|
+
it { should include(app.root.join("app/content").to_s) }
|
26
44
|
end
|
27
45
|
context "helpers" do
|
28
46
|
let(:path) { "app/helpers" }
|
29
|
-
it { should include(
|
47
|
+
it { should include(app.root.join("app/content/helpers").to_s) }
|
30
48
|
end
|
31
49
|
context "assets" do
|
32
50
|
let(:path) { "app/assets" }
|
33
|
-
it { should include(
|
51
|
+
it { should include(app.root.join("app/content/assets").to_s) }
|
52
|
+
end
|
53
|
+
end
|
54
|
+
context "#partals" do
|
55
|
+
it "excludes partials" do
|
56
|
+
expect(subject.site.resources.size).to eql(2)
|
34
57
|
end
|
35
58
|
end
|
36
|
-
end
|
59
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -15,8 +15,10 @@ RSpec.configure do |config|
|
|
15
15
|
config.use_transactional_fixtures = true
|
16
16
|
config.infer_base_class_for_anonymous_controllers = false
|
17
17
|
config.order = "random"
|
18
|
+
config.before(:each) do
|
19
|
+
Rails.application.reload_routes!
|
20
|
+
end
|
18
21
|
config.after(:each) do
|
19
22
|
Sitepress.reset_configuration
|
20
|
-
Rails.application.reload_routes!
|
21
23
|
end
|
22
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sitepress-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brad Gessler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqlite3
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rails
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +72,14 @@ dependencies:
|
|
58
72
|
requirements:
|
59
73
|
- - '='
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.1.
|
75
|
+
version: 0.1.23
|
62
76
|
type: :runtime
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - '='
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.1.
|
82
|
+
version: 0.1.23
|
69
83
|
description:
|
70
84
|
email:
|
71
85
|
- bradgessler@gmail.com
|
@@ -262,4 +276,3 @@ test_files:
|
|
262
276
|
- spec/sites/sample/pages/test.html.haml
|
263
277
|
- spec/sites/sample/pages/text.txt
|
264
278
|
- spec/spec_helper.rb
|
265
|
-
has_rdoc:
|