Skip to content

Commit ffe147b

Browse files
committed
Fixes README an specs descriptions
1 parent 691eca8 commit ffe147b

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ end
373373
You can mount the same endpoints in two different locations
374374

375375
```ruby
376-
class Voting::API < Grape::GrapeAPI
376+
class Voting::API < Grape::API
377377
namespace 'votes' do
378378
get do
379379
# Your logic
@@ -413,11 +413,11 @@ class Voting::API < Grape::API
413413
end
414414

415415
class Post::API < Grape::API
416-
mount Voting::API, with: {votable: 'posts'}
416+
mount Voting::API, with: { votable: 'posts' }
417417
end
418418

419419
class Comment::API < Grape::API
420-
mount Voting::API, with: {votable: 'comments'}
420+
mount Voting::API, with: { votable: 'comments' }
421421
end
422422
```
423423

spec/grape/remountable_api_spec.rb renamed to spec/grape/api_remount_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
require 'shared/versioning_examples'
33

44
describe Grape::API do
5-
subject(:a_remountable_api) { Class.new(Grape::API) }
5+
subject(:a_remounted_api) { Class.new(Grape::API) }
66
let(:root_api) { Class.new(Grape::API) }
77

88
def app
99
root_api
1010
end
1111

12-
describe 'mounted RemountableAPI' do
12+
describe 'remounting an API' do
1313
context 'with a defined route' do
1414
before do
15-
a_remountable_api.get '/votes' do
15+
a_remounted_api.get '/votes' do
1616
'10 votes'
1717
end
1818
end
1919

2020
context 'when mounting one instance' do
2121
before do
22-
root_api.mount a_remountable_api
22+
root_api.mount a_remounted_api
2323
end
2424

2525
it 'can access the endpoint' do
@@ -30,8 +30,8 @@ def app
3030

3131
context 'when mounting twice' do
3232
before do
33-
root_api.mount a_remountable_api => '/posts'
34-
root_api.mount a_remountable_api => '/comments'
33+
root_api.mount a_remounted_api => '/posts'
34+
root_api.mount a_remounted_api => '/comments'
3535
end
3636

3737
it 'can access the votes in both places' do
@@ -44,7 +44,7 @@ def app
4444

4545
context 'when mounting on namespace' do
4646
before do
47-
stub_const('StaticRefToAPI', a_remountable_api)
47+
stub_const('StaticRefToAPI', a_remounted_api)
4848
root_api.namespace 'posts' do
4949
mount StaticRefToAPI
5050
end
@@ -65,13 +65,13 @@ def app
6565

6666
context 'with a dynamically configured route' do
6767
before do
68-
a_remountable_api.namespace 'api' do
68+
a_remounted_api.namespace 'api' do
6969
get "/#{configuration[:path]}" do
7070
'10 votes'
7171
end
7272
end
73-
root_api.mount a_remountable_api, with: { path: 'votes' }
74-
root_api.mount a_remountable_api, with: { path: 'scores' }
73+
root_api.mount a_remounted_api, with: { path: 'votes' }
74+
root_api.mount a_remounted_api, with: { path: 'scores' }
7575
end
7676

7777
it 'will use the dynamic configuration on all routes' do

0 commit comments

Comments
 (0)