mascot-rails 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mascot/extensions/partials_remover.rb +19 -0
- data/lib/mascot/extensions/rails_request_paths.rb +17 -0
- data/lib/mascot/rails.rb +8 -0
- data/lib/mascot/rails_configuration.rb +5 -14
- data/lib/mascot/route_constraint.rb +1 -1
- data/spec/dummy/log/production.log +951 -0
- data/spec/dummy/log/test.log +8001 -0
- data/spec/mascot/extensions/partials_remover_spec.rb +12 -0
- data/spec/mascot/extensions/rails_request_paths_spec.rb +9 -0
- data/spec/mascot/rails_configuration_spec.rb +12 -5
- data/spec/mascot/route_constraint_spec.rb +4 -5
- data/spec/spec_helper.rb +1 -1
- metadata +10 -4
@@ -0,0 +1,12 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Mascot::Extensions::PartialsRemover do
|
4
|
+
context ".partial?" do
|
5
|
+
it "is true if begins with _" do
|
6
|
+
expect(Mascot::Extensions::PartialsRemover.partial?("/foo.bar/_buzz.haml")).to be true
|
7
|
+
end
|
8
|
+
it "is false if does not being with _" do
|
9
|
+
expect(Mascot::Extensions::PartialsRemover.partial?("/foo.bar/buzz.haml")).to be false
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -1,11 +1,18 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Mascot::RailsConfiguration do
|
4
|
-
subject { Mascot.
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
subject { Mascot::RailsConfiguration.new }
|
5
|
+
context "#partials" do
|
6
|
+
it "excludes by default" do
|
7
|
+
expect(subject.partials).to be false
|
8
|
+
end
|
9
|
+
it "excludes partials if false" do
|
10
|
+
subject.partials = false
|
11
|
+
expect(subject.resources.size).to eql(2)
|
12
|
+
end
|
13
|
+
it "includes partials if true" do
|
14
|
+
subject.partials = true
|
15
|
+
expect(subject.resources.size).to eql(3)
|
9
16
|
end
|
10
17
|
end
|
11
18
|
end
|
@@ -1,17 +1,16 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Mascot::RouteConstraint do
|
4
|
-
let(:
|
5
|
-
let(:route_constraint) { Mascot::RouteConstraint.new(sitemap) }
|
4
|
+
let(:subject) { Mascot::RouteConstraint.new }
|
6
5
|
|
7
6
|
context "#matches?" do
|
8
7
|
it "returns true if match" do
|
9
|
-
request = double("request", path: "/
|
10
|
-
expect(
|
8
|
+
request = double("request", path: "/time")
|
9
|
+
expect(subject.matches?(request)).to be(true)
|
11
10
|
end
|
12
11
|
it "returns false if not match" do
|
13
12
|
request = double("request", path: "/does-not-exist")
|
14
|
-
expect(
|
13
|
+
expect(subject.matches?(request)).to be(false)
|
15
14
|
end
|
16
15
|
end
|
17
16
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -16,7 +16,7 @@ RSpec.configure do |config|
|
|
16
16
|
config.infer_base_class_for_anonymous_controllers = false
|
17
17
|
config.order = "random"
|
18
18
|
config.after(:each) do
|
19
|
-
Mascot.
|
19
|
+
Mascot.reset_configuration
|
20
20
|
Rails.application.reload_routes!
|
21
21
|
end
|
22
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mascot-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
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-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqlite3
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.1.
|
61
|
+
version: 0.1.8
|
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: 0.1.
|
68
|
+
version: 0.1.8
|
69
69
|
description:
|
70
70
|
email:
|
71
71
|
- bradgessler@gmail.com
|
@@ -81,6 +81,8 @@ files:
|
|
81
81
|
- lib/mascot-rails.rb
|
82
82
|
- lib/mascot/action_controller_context.rb
|
83
83
|
- lib/mascot/engine.rb
|
84
|
+
- lib/mascot/extensions/partials_remover.rb
|
85
|
+
- lib/mascot/extensions/rails_request_paths.rb
|
84
86
|
- lib/mascot/rails.rb
|
85
87
|
- lib/mascot/rails_configuration.rb
|
86
88
|
- lib/mascot/route_constraint.rb
|
@@ -145,6 +147,8 @@ files:
|
|
145
147
|
- spec/dummy/public/favicon.ico
|
146
148
|
- spec/mascot-rails_spec.rb
|
147
149
|
- spec/mascot/action_controller_context_spec.rb
|
150
|
+
- spec/mascot/extensions/partials_remover_spec.rb
|
151
|
+
- spec/mascot/extensions/rails_request_paths_spec.rb
|
148
152
|
- spec/mascot/mascot_sitemap_controller_spec.rb
|
149
153
|
- spec/mascot/rails_configuration_spec.rb
|
150
154
|
- spec/mascot/route_constraint_spec.rb
|
@@ -237,6 +241,8 @@ test_files:
|
|
237
241
|
- spec/dummy/public/favicon.ico
|
238
242
|
- spec/dummy/Rakefile
|
239
243
|
- spec/mascot/action_controller_context_spec.rb
|
244
|
+
- spec/mascot/extensions/partials_remover_spec.rb
|
245
|
+
- spec/mascot/extensions/rails_request_paths_spec.rb
|
240
246
|
- spec/mascot/mascot_sitemap_controller_spec.rb
|
241
247
|
- spec/mascot/rails_configuration_spec.rb
|
242
248
|
- spec/mascot/route_constraint_spec.rb
|