forked from ensiie/iaato
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathall
38 lines (29 loc) · 742 Bytes
/
all
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require 'spec_helper'
describe 'API', type: :request do
describe 'Ship' do
context 'get all' do
before { get '/api/ships' }
describe 'response' do
subject { last_response }
it { should be_ok }
its(:body) { should have_json_type Array }
end
end
context 'get one' do
before {
@ship = create :ship, name: 'concordia'
get "/api/ships/#{@ship.id}"
}
describe 'reponse' do
subject { last_response }
it { should be_ok }
its(:body) { should be_json_eql(%("concordia")).at_path('name') }
end
context 'update' do
before {
@ship = create :ship, name: 'concodia'
}
end
end
end
end