Skip to content

Commit

Permalink
reorganizing specs
Browse files Browse the repository at this point in the history
  • Loading branch information
afeld committed Jun 18, 2011
1 parent 7ca9984 commit d349e71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
9 changes: 9 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,12 @@
# config.mock_with :rr
config.mock_with :rspec
end


def get_photo(filename='dubya.jpeg')
image_url = "http://www.foo.com/#{filename}"
image_path = File.join(File.dirname(__FILE__), 'support', filename)
stub_request(:get, image_url).to_return(:body => File.new(image_path))

Magickly.dragonfly.fetch(image_url)
end
14 changes: 2 additions & 12 deletions spec/unit/analyser_spec.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# P.S. I'm pretty sure it's spelled "analyZer", but I'm staying consistent w/ Dragonfly
require 'spec_helper'

describe "retrieving face data" do
def get_photo(filename='dubya.jpeg')
image_url = "http://www.foo.com/#{filename}"
image_path = File.join(File.dirname(__FILE__), '..', 'support', filename)
stub_request(:get, image_url).to_return(:body => File.new(image_path))

Magickly.dragonfly.fetch(image_url)
end

describe "analysers" do
def face_data(filename='dubya.jpeg')
photo = get_photo(filename)
data = nil
Expand Down Expand Up @@ -51,9 +43,7 @@ def face_data_as_px(filename='dubya.jpeg')
image = get_photo
image.height.should eq 300

VCR.use_cassette('dubya') do
image.face_data_as_px['height'].should eq 300
end
face_data_as_px['height'].should eq 300
end

it "should scale the detection areas proportionally for large photos" do
Expand Down

0 comments on commit d349e71

Please sign in to comment.