Skip to content

Commit 78bf5ac

Browse files
committedOct 15, 2014
Some cleanup
1 parent cb6bbfe commit 78bf5ac

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed
 

‎spec/http_spec.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
describe HTTP do
44
describe ".setup" do
55
it 'presents the $.ajaxSetup() object as a Hash' do
6-
HTTP.setup.should be_a Hash
6+
expect(HTTP.setup).to be_a Hash
77
end
88
end
99

@@ -16,13 +16,13 @@
1616

1717
async "block gets called on success" do
1818
HTTP.get('spec/fixtures/simple.txt') do |response|
19-
run_async { response.should be_ok }
19+
async { response.should be_ok }
2020
end
2121
end
2222

2323
async "block gets called on failure" do
2424
HTTP.get('/spec/does/not/exist.txt') do |response|
25-
run_async { response.should_not be_ok }
25+
async { response.should_not be_ok }
2626
end
2727
end
2828
end
@@ -34,13 +34,13 @@
3434

3535
async "returns a promise which accepts a then-block for successful response" do
3636
HTTP.get('spec/fixtures/simple.txt').then do |response|
37-
run_async { response.should be_ok }
37+
async { response.should be_ok }
3838
end
3939
end
4040

4141
async "returns a promise which accepts a fail-block for failing response" do
4242
HTTP.get('spec/does/not/exist.txt').fail do |response|
43-
run_async { response.should_not be_ok }
43+
async { response.should_not be_ok }
4444
end
4545
end
4646
end
@@ -49,29 +49,29 @@
4949
describe '#body' do
5050
async 'returns the response body as a string' do
5151
HTTP.get('spec/fixtures/simple.txt') do |response|
52-
run_async { response.body.should == "hey" }
52+
async { response.body.should == "hey" }
5353
end
5454
end
5555
end
5656

5757
describe '#json' do
5858
async 'returns the json converted into native ruby objects' do
5959
HTTP.get('spec/fixtures/user.json') do |response|
60-
run_async { response.json.should == { 'name' => 'Adam', 'age' => 26 } }
60+
async { response.json.should == { 'name' => 'Adam', 'age' => 26 } }
6161
end
6262
end
6363
end
6464

6565
describe '#ok?' do
6666
async 'returns true when the request was a sucess' do
6767
HTTP.get('spec/fixtures/simple.txt') do |response|
68-
run_async { response.should be_ok }
68+
async { expect(response).to be_ok }
6969
end
7070
end
7171

7272
async 'returns false when the request failed' do
7373
HTTP.get('spec/fixtures/non_existant.txt') do |response|
74-
run_async { response.should_not be_ok }
74+
async { response.should_not be_ok }
7575
end
7676
end
7777
end

0 commit comments

Comments
 (0)
Please sign in to comment.