Skip to content

Commit

Permalink
Put all spec fixtures under spec/fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Nov 1, 2013
1 parent 69c58fe commit 6cacc6f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions spec/http_spec.rb
Expand Up @@ -3,15 +3,15 @@
describe HTTP do
describe '#body' do
async 'returns the response body as a string' do
HTTP.get('spec/data/simple.txt') do |response|
HTTP.get('spec/fixtures/simple.txt') do |response|
run_async { response.body.should == "hey" }
end
end
end

describe '#callback' do
async 'can add a success callback after the request is sent' do
http = HTTP.get('spec/data/simple.txt')
http = HTTP.get('spec/fixtures/simple.txt')
http.callback do |response|
run_async { response.ok?.should be_true }
end
Expand All @@ -20,7 +20,7 @@

describe '#callback' do
async 'can add a failure callback after the request is sent' do
http = HTTP.get('spec/data/bad_url.txt')
http = HTTP.get('spec/fixtures/bad_url.txt')
http.errback do |response|
run_async { response.ok?.should be_false }
end
Expand All @@ -29,21 +29,21 @@

describe '#json' do
async 'returns the json converted into native ruby objects' do
HTTP.get('spec/data/user.json') do |response|
HTTP.get('spec/fixtures/user.json') do |response|
run_async { response.json.should == { 'name' => 'Adam', 'age' => 26 } }
end
end
end

describe '#ok?' do
async 'returns true when the request was a sucess' do
HTTP.get('spec/data/simple.txt') do |response|
HTTP.get('spec/fixtures/simple.txt') do |response|
run_async { response.ok?.should be_true }
end
end

async 'returns false when the request failed' do
HTTP.get('spec/data/non_existant.txt') do |response|
HTTP.get('spec/fixtures/non_existant.txt') do |response|
run_async { response.ok?.should be_false }
end
end
Expand Down

0 comments on commit 6cacc6f

Please sign in to comment.