sitepress-rails 2.0.0.beta7 → 2.0.0.beta8

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.
@@ -65373,3 +65373,119 @@ Processing by Sitepress::SiteController#show as HTML
65373
65373
  Rendered inline template within layouts/application (Duration: 0.1ms | Allocations: 64)
65374
65374
  Rendered layout layouts/application.html.erb (Duration: 0.3ms | Allocations: 104)
65375
65375
  Completed 200 OK in 1ms (Views: 0.5ms | Allocations: 856)
65376
+ Processing by Sitepress::SiteController#show as HTML
65377
+ Parameters: {"resource_path"=>"/all_pages"}
65378
+ Rendering layout layouts/application.html.erb
65379
+ Rendering inline template within layouts/application
65380
+ Rendered inline template within layouts/application (Duration: 0.9ms | Allocations: 196)
65381
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
65382
+ Rendered layout layouts/application.html.erb (Duration: 1.1ms | Allocations: 276)
65383
+ Completed 200 OK in 11ms (Views: 5.1ms | Allocations: 3250)
65384
+ Processing by Sitepress::SiteController#show as HTML
65385
+ Parameters: {"resource_path"=>"/non-existent"}
65386
+ Completed 404 Not Found in 1ms (Allocations: 440)
65387
+ Processing by Sitepress::SiteController#show as HTML
65388
+ Parameters: {"resource_path"=>"/hi"}
65389
+ Rendering layout layouts/application.html.erb
65390
+ Rendering inline template within layouts/application
65391
+ Rendered inline template within layouts/application (Duration: 0.2ms | Allocations: 73)
65392
+ Rendered layout layouts/application.html.erb (Duration: 0.8ms | Allocations: 229)
65393
+ Completed 200 OK in 4ms (Views: 2.1ms | Allocations: 1001)
65394
+ Processing by Sitepress::SiteController#show as HTML
65395
+ Parameters: {"resource_path"=>"/hi"}
65396
+ Rendering layout layouts/application.html.erb
65397
+ Rendering inline template within layouts/application
65398
+ Rendered inline template within layouts/application (Duration: 0.2ms | Allocations: 64)
65399
+ Rendered layout layouts/application.html.erb (Duration: 0.3ms | Allocations: 104)
65400
+ Completed 200 OK in 3ms (Views: 1.1ms | Allocations: 875)
65401
+ Processing by Sitepress::SiteController#show as HTML
65402
+ Parameters: {"resource_path"=>"/hi"}
65403
+ Rendering layout layouts/application.html.erb
65404
+ Rendering inline template within layouts/application
65405
+ Rendered inline template within layouts/application (Duration: 0.1ms | Allocations: 64)
65406
+ Rendered layout layouts/application.html.erb (Duration: 0.3ms | Allocations: 104)
65407
+ Completed 200 OK in 3ms (Views: 1.1ms | Allocations: 875)
65408
+ Processing by Sitepress::SiteController#show as HTML
65409
+ Parameters: {"resource_path"=>"/hi"}
65410
+ Rendering layout layouts/application.html.erb
65411
+ Rendering inline template within layouts/application
65412
+ Rendered inline template within layouts/application (Duration: 0.2ms | Allocations: 64)
65413
+ Rendered layout layouts/application.html.erb (Duration: 0.3ms | Allocations: 104)
65414
+ Completed 200 OK in 3ms (Views: 1.4ms | Allocations: 875)
65415
+ Processing by Sitepress::SiteController#show as HTML
65416
+ Parameters: {"resource_path"=>"/time"}
65417
+ Rendering layout app/content/layouts/sitepress_test_layout.html.erb
65418
+ Rendering inline template within layouts/sitepress_test_layout
65419
+ Rendered app/content/pages/_stupid.html.erb (Duration: 0.6ms | Allocations: 73)
65420
+ Rendered app/content/pages/partials/_really_stupid.html.erb (Duration: 0.4ms | Allocations: 72)
65421
+ Rendered inline template within layouts/sitepress_test_layout (Duration: 4.2ms | Allocations: 835)
65422
+ Rendered layout app/content/layouts/sitepress_test_layout.html.erb (Duration: 4.9ms | Allocations: 984)
65423
+ Completed 200 OK in 9ms (Views: 5.9ms | Allocations: 2061)
65424
+ Processing by Sitepress::SiteController#show as HTML
65425
+ Parameters: {"resource_path"=>"/time"}
65426
+ Rendering layout app/content/layouts/sitepress_test_layout.html.erb
65427
+ Rendering inline template within layouts/sitepress_test_layout
65428
+ Rendered app/content/pages/_stupid.html.erb (Duration: 0.0ms | Allocations: 6)
65429
+ Rendered app/content/pages/partials/_really_stupid.html.erb (Duration: 0.0ms | Allocations: 5)
65430
+ Rendered inline template within layouts/sitepress_test_layout (Duration: 0.5ms | Allocations: 265)
65431
+ Rendered layout app/content/layouts/sitepress_test_layout.html.erb (Duration: 0.6ms | Allocations: 305)
65432
+ Completed 200 OK in 2ms (Views: 0.9ms | Allocations: 1118)
65433
+ Processing by Sitepress::SiteController#show as HTML
65434
+ Parameters: {"resource_path"=>"/time"}
65435
+ Rendering layout app/content/layouts/sitepress_test_layout.html.erb
65436
+ Rendering inline template within layouts/sitepress_test_layout
65437
+ Rendered app/content/pages/_stupid.html.erb (Duration: 0.0ms | Allocations: 6)
65438
+ Rendered app/content/pages/partials/_really_stupid.html.erb (Duration: 0.0ms | Allocations: 5)
65439
+ Rendered inline template within layouts/sitepress_test_layout (Duration: 0.4ms | Allocations: 262)
65440
+ Rendered layout app/content/layouts/sitepress_test_layout.html.erb (Duration: 0.6ms | Allocations: 302)
65441
+ Completed 200 OK in 2ms (Views: 0.8ms | Allocations: 1112)
65442
+ Processing by Sitepress::SiteController#show as HTML
65443
+ Parameters: {"resource_path"=>"/time"}
65444
+ Rendering layout app/content/layouts/sitepress_test_layout.html.erb
65445
+ Rendering inline template within layouts/sitepress_test_layout
65446
+ Rendered app/content/pages/_stupid.html.erb (Duration: 0.0ms | Allocations: 6)
65447
+ Rendered app/content/pages/partials/_really_stupid.html.erb (Duration: 0.0ms | Allocations: 5)
65448
+ Rendered inline template within layouts/sitepress_test_layout (Duration: 0.6ms | Allocations: 263)
65449
+ Rendered layout app/content/layouts/sitepress_test_layout.html.erb (Duration: 0.7ms | Allocations: 303)
65450
+ Completed 200 OK in 2ms (Views: 1.0ms | Allocations: 1113)
65451
+ Processing by Sitepress::SiteController#show as HTML
65452
+ Parameters: {"resource_path"=>"/time"}
65453
+ Rendering layout app/content/layouts/sitepress_test_layout.html.erb
65454
+ Rendering inline template within layouts/sitepress_test_layout
65455
+ Rendered app/content/pages/_stupid.html.erb (Duration: 0.0ms | Allocations: 6)
65456
+ Rendered app/content/pages/partials/_really_stupid.html.erb (Duration: 0.0ms | Allocations: 5)
65457
+ Rendered inline template within layouts/sitepress_test_layout (Duration: 0.5ms | Allocations: 262)
65458
+ Rendered layout app/content/layouts/sitepress_test_layout.html.erb (Duration: 0.6ms | Allocations: 302)
65459
+ Completed 200 OK in 2ms (Views: 0.9ms | Allocations: 1114)
65460
+ Processing by Sitepress::SiteController#show as HTML
65461
+ Parameters: {"resource_path"=>"/time"}
65462
+ Rendering layout app/content/layouts/sitepress_test_layout.html.erb
65463
+ Rendering inline template within layouts/sitepress_test_layout
65464
+ Rendered app/content/pages/_stupid.html.erb (Duration: 0.0ms | Allocations: 6)
65465
+ Rendered app/content/pages/partials/_really_stupid.html.erb (Duration: 0.0ms | Allocations: 5)
65466
+ Rendered inline template within layouts/sitepress_test_layout (Duration: 0.5ms | Allocations: 262)
65467
+ Rendered layout app/content/layouts/sitepress_test_layout.html.erb (Duration: 0.6ms | Allocations: 302)
65468
+ Completed 200 OK in 2ms (Views: 0.9ms | Allocations: 1112)
65469
+ Processing by Sitepress::SiteController#show as HTML
65470
+ Parameters: {"resource_path"=>"all_pages"}
65471
+ Rendering layout layouts/application.html.erb
65472
+ Rendering inline template within layouts/application
65473
+ Rendered inline template within layouts/application (Duration: 0.2ms | Allocations: 47)
65474
+ Rendered layout layouts/application.html.erb (Duration: 0.4ms | Allocations: 86)
65475
+ Completed 200 OK in 2ms (Views: 0.7ms | Allocations: 570)
65476
+ Processing by Sitepress::SiteController#show as HTML
65477
+ Parameters: {"resource_path"=>"time"}
65478
+ Rendering layout app/content/layouts/sitepress_test_layout.html.erb
65479
+ Rendering inline template within layouts/sitepress_test_layout
65480
+ Rendered app/content/pages/_stupid.html.erb (Duration: 0.0ms | Allocations: 6)
65481
+ Rendered app/content/pages/partials/_really_stupid.html.erb (Duration: 0.0ms | Allocations: 5)
65482
+ Rendered inline template within layouts/sitepress_test_layout (Duration: 0.5ms | Allocations: 262)
65483
+ Rendered layout app/content/layouts/sitepress_test_layout.html.erb (Duration: 0.6ms | Allocations: 302)
65484
+ Completed 200 OK in 1ms (Views: 0.8ms | Allocations: 778)
65485
+ Processing by Sitepress::SiteController#show as HTML
65486
+ Parameters: {"resource_path"=>"hi"}
65487
+ Rendering layout layouts/application.html.erb
65488
+ Rendering inline template within layouts/application
65489
+ Rendered inline template within layouts/application (Duration: 0.1ms | Allocations: 64)
65490
+ Rendered layout layouts/application.html.erb (Duration: 0.2ms | Allocations: 104)
65491
+ Completed 200 OK in 1ms (Views: 0.4ms | Allocations: 543)
@@ -12,31 +12,8 @@ describe "Sitepress.configuration" do
12
12
  app.initialize!
13
13
  expect(subject.parent_engine).to eql(app)
14
14
  end
15
- it "has Rails.application as parent engine" do
16
- app.initialize!
17
- expect(subject.cache_resources).to be_nil
18
- end
19
15
  it "has routes enabled by default" do
20
16
  app.initialize!
21
17
  expect(subject.routes).to be true
22
18
  end
23
- context "#cache_resources" do
24
- before do
25
- app.config.cache_classes = cache_classes # This is what I really want to test.
26
- end
27
- context "Rails.configuration.cache_classes=true" do
28
- let(:cache_classes) { true }
29
- it "is true" do
30
- app.initialize!
31
- expect(subject.cache_resources).to eql(true)
32
- end
33
- end
34
- context "Rails.configuration.cache_classes=false" do
35
- let(:cache_classes) { false }
36
- it "is false" do
37
- app.initialize!
38
- expect(subject.cache_resources).to eql(false)
39
- end
40
- end
41
- end
42
19
  end
@@ -4,16 +4,16 @@ require "fileutils"
4
4
 
5
5
  describe Sitepress::Compiler do
6
6
  let(:site) { Sitepress.site }
7
- let(:target) { Pathname.new(Dir::tmpdir).join("build") }
7
+ let(:build_path) { Pathname.new(Dir::tmpdir).join("build") }
8
8
  # Write compiler output to /dev/null so our test output remains clean.
9
9
  let(:stdout) { File.open(File::NULL, "w") }
10
- subject { Sitepress::Compiler.new(site: site, stdout: stdout) }
10
+ subject { Sitepress::Compiler.new(site: site, stdout: stdout, root_path: build_path) }
11
11
  describe "#compile" do
12
- before { FileUtils.mkdir_p(target) }
13
- after { FileUtils.rm_rf(target) }
14
- it "writes files to target" do
15
- subject.compile(target_path: target)
16
- expect(Dir.glob(target.join("**")).size).to eql(2) # 2 items in the site... mkay?
12
+ before { FileUtils.mkdir_p(build_path) }
13
+ after { FileUtils.rm_rf(build_path) }
14
+ it "writes files to build_path" do
15
+ subject.compile
16
+ expect(Dir.glob(build_path.join("**")).size).to eql(3) # 2 items in the site... mkay?
17
17
  end
18
18
  end
19
19
  end
@@ -79,27 +79,8 @@ describe Sitepress::SiteController, type: :controller do
79
79
  end
80
80
  end
81
81
 
82
- context "render cache" do
83
- context "cache_resources=true" do
84
- before { site.cache_resources = true }
85
- it "enables cache" do
86
- expect(site.cache_resources).to be true
87
- expect(site).to receive(:cache_resources=).with(true)
88
- expect(site).to receive(:cache_resources=).with(true)
89
- get_resource "/time"
90
- expect(site.cache_resources).to be true
91
- end
92
- end
93
- context "cache_resources=false" do
94
- before { site.cache_resources = false }
95
- it "enables cache" do
96
- expect(site.cache_resources).to be false
97
- expect(site).to receive(:cache_resources=).with(true)
98
- expect(site).to receive(:cache_resources=).with(false)
99
- get_resource "/time"
100
- expect(site.cache_resources).to be false
101
- end
102
- end
103
-
82
+ it "builds site once" do
83
+ allow(site).to receive(:root).once.and_return(site.root)
84
+ get_resource "/all_pages"
104
85
  end
105
86
  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: 2.0.0.beta7
4
+ version: 2.0.0.beta8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-15 00:00:00.000000000 Z
11
+ date: 2021-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-rails
@@ -58,42 +58,42 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 2.0.0.beta7
61
+ version: 2.0.0.beta8
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 2.0.0.beta7
68
+ version: 2.0.0.beta8
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: railties
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '5.0'
75
+ version: '6.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '5.0'
82
+ version: '6.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: actionpack
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '5.0'
89
+ version: '6.0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '5.0'
96
+ version: '6.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: sprockets-rails
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -143,6 +143,7 @@ files:
143
143
  - spec/dummy/app/content/helpers/sample_helper.rb
144
144
  - spec/dummy/app/content/layouts/sitepress_test_layout.html.erb
145
145
  - spec/dummy/app/content/pages/_stupid.html.erb
146
+ - spec/dummy/app/content/pages/all_pages.html.erb.html
146
147
  - spec/dummy/app/content/pages/hi.html
147
148
  - spec/dummy/app/content/pages/partials/_really_stupid.html.erb
148
149
  - spec/dummy/app/content/pages/time.html.erb
@@ -233,6 +234,7 @@ test_files:
233
234
  - spec/sitepress-rails_spec.rb
234
235
  - spec/dummy/app/mailers/application_mailer.rb
235
236
  - spec/dummy/app/content/layouts/sitepress_test_layout.html.erb
237
+ - spec/dummy/app/content/pages/all_pages.html.erb.html
236
238
  - spec/dummy/app/content/pages/time.html.erb
237
239
  - spec/dummy/app/content/pages/_stupid.html.erb
238
240
  - spec/dummy/app/content/pages/hi.html