Skip to content

Commit eabfedf

Browse files
committed
removed redundant /api from namespace
1 parent 103aebc commit eabfedf

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

app.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class SpacexAPI < Sinatra::Base
5656
# end
5757

5858
# Sets namespace for all following URL's
59-
namespace '/api/v1' do
59+
namespace '/v1' do
6060

6161
##########################################
6262
# Basic Info Endpoints

test/test.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,104 +17,104 @@ def app
1717
##########################################
1818

1919
def test_home
20-
get '/api/v1/'
20+
get '/v1/'
2121
assert last_response.ok?
2222
data = JSON.parse(last_response.body)
2323
assert data.count > 0
2424
end
2525

2626
def test_info
27-
get '/api/v1/info'
27+
get '/v1/info'
2828
assert last_response.ok?
2929
data = JSON.parse(last_response.body)
3030
assert data.count > 0
3131
end
3232

3333
def test_latest
34-
get '/api/v1/launches/latest'
34+
get '/v1/launches/latest'
3535
assert last_response.ok?
3636
data = JSON.parse(last_response.body)
3737
assert data.count == 1
3838
end
3939

4040
def test_launchpads
41-
get '/api/v1/launchpads'
41+
get '/v1/launchpads'
4242
assert last_response.ok?
4343
data = JSON.parse(last_response.body)
4444
assert data.count > 0
4545
end
4646

4747
def test_vehicle
48-
get '/api/v1/vehicles'
48+
get '/v1/vehicles'
4949
assert last_response.ok?
5050
data = JSON.parse(last_response.body)
5151
assert data.count > 0
5252
end
5353

5454
def test_falcon1
55-
get '/api/v1/vehicles/falcon1'
55+
get '/v1/vehicles/falcon1'
5656
assert last_response.ok?
5757
data = JSON.parse(last_response.body)
5858
assert data.count > 0
5959
end
6060

6161
def test_falcon9
62-
get '/api/v1/vehicles/falcon9'
62+
get '/v1/vehicles/falcon9'
6363
assert last_response.ok?
6464
data = JSON.parse(last_response.body)
6565
assert data.count > 0
6666
end
6767

6868
def test_falconheavy
69-
get '/api/v1/vehicles/falconheavy'
69+
get '/v1/vehicles/falconheavy'
7070
assert last_response.ok?
7171
data = JSON.parse(last_response.body)
7272
assert data.count > 0
7373
end
7474

7575
def test_dragon
76-
get '/api/v1/vehicles/dragon'
76+
get '/v1/vehicles/dragon'
7777
assert last_response.ok?
7878
data = JSON.parse(last_response.body)
7979
assert data.count > 0
8080
end
8181

8282
def test_launches
83-
get '/api/v1/launches'
83+
get '/v1/launches'
8484
assert last_response.ok?
8585
data = JSON.parse(last_response.body)
8686
assert data.count > 0
8787
end
8888

8989
def test_upcoming
90-
get '/api/v1/launches/upcoming'
90+
get '/v1/launches/upcoming'
9191
assert last_response.ok?
9292
data = JSON.parse(last_response.body)
9393
assert data.count > 0
9494
end
9595

9696
def test_launches_year
97-
get '/api/v1/launches?year=2010'
97+
get '/v1/launches?year=2010'
9898
assert last_response.ok?
9999
assert last_response.body.include?('2010')
100100
end
101101

102102
def test_launches_date
103-
get '/api/v1/launches?from=2011-01-20&to=2013-05-25'
103+
get '/v1/launches?from=2011-01-20&to=2013-05-25'
104104
assert last_response.ok?
105105
data = JSON.parse(last_response.body)
106106
assert data.count == 3
107107
end
108108

109109
def test_caps
110-
get '/api/v1/parts/caps'
110+
get '/v1/parts/caps'
111111
assert last_response.ok?
112112
data = JSON.parse(last_response.body)
113113
assert data.count > 0
114114
end
115115

116116
def test_cores
117-
get '/api/v1/parts/cores'
117+
get '/v1/parts/cores'
118118
assert last_response.ok?
119119
data = JSON.parse(last_response.body)
120120
assert data.count > 0

0 commit comments

Comments
 (0)