add routing specs
This commit is contained in:
parent
7a74b4e01d
commit
38b31ea464
3 changed files with 41 additions and 2 deletions
|
|
@ -18,13 +18,13 @@ guard :rspec, cmd: "NO_COVERAGE=true bin/rspec" do
|
|||
|
||||
watch(rails.controllers) do |m|
|
||||
[
|
||||
# rspec.spec.call("routing/#{m[1]}_routing"),
|
||||
rspec.spec.call("routing/#{m[1]}_routing"),
|
||||
rspec.spec.call("controllers/#{m[1]}_controller")
|
||||
]
|
||||
end
|
||||
|
||||
# Rails config changes
|
||||
watch(rails.spec_helper) { rspec.spec_dir }
|
||||
# watch(rails.routes) { "#{rspec.spec_dir}/routing" }
|
||||
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
|
||||
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
|
||||
end
|
||||
|
|
|
|||
20
spec/routing/receive_routing_spec.rb
Normal file
20
spec/routing/receive_routing_spec.rb
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
module DiasporaFederation
|
||||
describe ReceiveController, type: :routing do
|
||||
routes { DiasporaFederation::Engine.routes }
|
||||
|
||||
it "routes POST public" do
|
||||
expect(post: "/receive/public").to route_to(
|
||||
controller: "diaspora_federation/receive",
|
||||
action: "public"
|
||||
)
|
||||
end
|
||||
|
||||
it "routes POST private" do
|
||||
expect(post: "/receive/users/1234").to route_to(
|
||||
controller: "diaspora_federation/receive",
|
||||
action: "private",
|
||||
guid: "1234"
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
19
spec/routing/webfinger_routing_spec.rb
Normal file
19
spec/routing/webfinger_routing_spec.rb
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
module DiasporaFederation
|
||||
describe ReceiveController, type: :routing do
|
||||
routes { DiasporaFederation::Engine.routes }
|
||||
|
||||
it "routes GET host-meta" do
|
||||
expect(get: ".well-known/host-meta").to route_to(
|
||||
controller: "diaspora_federation/webfinger",
|
||||
action: "host_meta"
|
||||
)
|
||||
end
|
||||
|
||||
it "routes GET legacy webfinger" do
|
||||
expect(get: "/webfinger").to route_to(
|
||||
controller: "diaspora_federation/webfinger",
|
||||
action: "legacy_webfinger"
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue