Sha256: 9152af852791ec895a8aee56215e544dddd2ecc008c671c80c9a394a1e37a836

Contents?: true

Size: 647 Bytes

Versions: 3

Compression:

Stored size: 647 Bytes

Contents

require_relative 'spec_helper'
require 'mocha'

require_relative '../lib/doc_juan/url_helper'

describe 'DocJuan#url' do
  before :each do
    DocJuan.config.host = 'doc-juan.example.com'
    DocJuan.config.secret = 'zecret'
  end

  it 'passes its arguments to a UrlGenerator instance and uses it to generate the url' do
    generator = stub
    generator.expects(:generate).returns 'generated-url'
    DocJuan::UrlGenerator.expects(:new).
      with('http://example.com', 'the_file.pdf', size: 'A4').
      returns(generator)

    url = DocJuan.url 'http://example.com', 'the_file.pdf', size: 'A4'

    url.must_equal 'generated-url'
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
doc_juan-1.1.0 spec/url_helper_spec.rb
doc_juan-1.0.1 spec/url_helper_spec.rb
doc_juan-1.0.0 spec/url_helper_spec.rb