Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d2a5435

Browse files
AxiosLeoJacksonTian
authored andcommitted
fix ci
1 parent 47a3f87 commit d2a5435

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

‎.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ install:
1717
- gem update --system
1818
- gem install bundler
1919
- gem install rspec
20-
21-
before_install:
20+
- bundle -v
2221
- bundle install
2322

2423
script:
2524
- bundle exec rspec --exclude-pattern spec/**/*_integration_spec.rb
26-
- test -z $ACCESS_KEY_ID -a -z $ACCESS_KEY_SECRET || bundle exec rspec -P spec/**/*_integration_spec.rb
25+
- test -z $ACCESS_KEY_ID -a -z $ACCESS_KEY_SECRET || bundle exec rspec -P spec/**/*_integration_spec.rb

‎spec/roa_client_spec.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
it 'json response should ok' do
125125
stub_request(:get, "https://ros.aliyuncs.com/")
126126
.to_return(status: 200, headers: { 'Content-Type': 'application/json' }, body: { ok: true }.to_json)
127-
response = roa_client.get(uri: '/')
127+
response = roa_client.get(uri: '/',headers: {'content-type': 'application/json'})
128128
expect(response.body).to eq({ ok: true }.to_json)
129129
end
130130
end
@@ -133,7 +133,7 @@
133133
it 'json response should ok' do
134134
stub_request(:get, "https://ros.aliyuncs.com/")
135135
.to_return(status: 204, headers: { 'Content-Type': 'application/json' }, body: '')
136-
response = roa_client.get(uri: '/')
136+
response = roa_client.get(uri: '/',headers: {'content-type': 'application/json'})
137137
expect(response.body).to eq('')
138138
end
139139
end
@@ -146,7 +146,7 @@
146146
stub_request(:get, "https://ros.aliyuncs.com/")
147147
.to_return(status: status, headers: headers, body: body)
148148
expect {
149-
roa_client.get(uri: '/')
149+
roa_client.get(uri: '/',headers: {'content-type': 'application/json'})
150150
}.to raise_error(StandardError, 'code: 400, error message requestid: requestid')
151151
end
152152
end
@@ -167,7 +167,7 @@
167167
it 'xml response should ok' do
168168
stub_request(:get, "https://ros.aliyuncs.com/")
169169
.to_return(status: status, headers: headers, body: body)
170-
response = roa_client.get(uri: '/')
170+
response = roa_client.get(uri: '/',headers: {'content-type': 'application/json'})
171171
expect(response.body).to eq(body)
172172
end
173173
end
@@ -189,48 +189,48 @@
189189
stub_request(:get, "https://ros.aliyuncs.com/")
190190
.to_return(status: status, headers: headers, body: body)
191191
expect {
192-
roa_client.get(uri: '/')
192+
roa_client.get(uri: '/',headers: {'content-type': 'application/json'})
193193
}.to raise_error(ROAClient::ACSError, 'error message host_id: hostid, request_id: requestid')
194194
end
195195
end
196196

197197
describe 'request(200) with plain response should ok' do
198198
it 'plain response should ok' do
199199
stub_request(:get, "https://ros.aliyuncs.com/").to_return(status: 200, body: 'plain text')
200-
response = roa_client.get(uri: '/')
200+
response = roa_client.get(uri: '/',headers: {'content-type': 'application/json'})
201201
expect(response.body).to eq('plain text')
202202
end
203203
end
204204

205205
describe 'post should ok' do
206206
it 'should ok' do
207-
stub_request(:get, "https://ros.aliyuncs.com/")
207+
stub_request(:post, "https://ros.aliyuncs.com/")
208208
.to_return(status: 200, headers: { 'content-type': 'application/json' }, body: { ok: true }.to_json)
209-
response = roa_client.post(uri: '/', body: 'text')
209+
response = roa_client.post(uri: '/', headers: {'content-type': 'application/json'},body: 'text')
210210
expect(response.body).to eq('{"ok":true}')
211211
end
212212
it 'should ok with query' do
213-
stub_request(:get, "https://ros.aliyuncs.com/?k=v")
213+
stub_request(:post, "https://ros.aliyuncs.com/?k=v")
214214
.to_return(status: 200, headers: { 'content-type': 'application/json' }, body: { ok: true }.to_json)
215-
response = roa_client.post(uri: '/', params: { k: 'v' }, body: 'text')
215+
response = roa_client.post(uri: '/', headers: {'content-type': 'application/json'},params: { k: 'v' }, body: 'text')
216216
expect(response.body).to eq('{"ok":true}')
217217
end
218218
end
219219

220220
describe 'put should ok' do
221221
it 'should ok' do
222-
stub_request(:get, "https://ros.aliyuncs.com/")
222+
stub_request(:put, "https://ros.aliyuncs.com/")
223223
.to_return(status: 200, headers: { 'content-type': 'application/json' }, body: { ok: true }.to_json)
224-
response = roa_client.put(uri: '/', body: 'text')
224+
response = roa_client.put(uri: '/', headers: {'content-type': 'application/json'},body: 'text')
225225
expect(response.body).to eq('{"ok":true}')
226226
end
227227
end
228228

229229
describe 'delete should ok' do
230230
it 'should ok' do
231-
stub_request(:get, "https://ros.aliyuncs.com/")
231+
stub_request(:delete, "https://ros.aliyuncs.com/")
232232
.to_return(status: 200, headers: { 'content-type': 'application/json' }, body: { ok: true }.to_json)
233-
response = roa_client.delete(uri: '/')
233+
response = roa_client.delete(uri: '/',headers: {'content-type': 'application/json'})
234234
expect(response.body).to eq('{"ok":true}')
235235
end
236236
end

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /