Sha256: 31a5def52bdba39297630eeae4549f1d4b2b0389801689523a6c8b61178e27c4

Contents?: true

Size: 575 Bytes

Versions: 1

Compression:

Stored size: 575 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'rack/test'
require_relative '../lib/dubai/server'

include Rack::Test::Methods

describe Dubai::Server do
  let(:app) { Dubai::Server }

  describe 'GET /pass.pkpass' do
    it 'returns pkpass' do
      Dubai::Server.set(:directory, 'directory')
      pkpass = double(string: 'your.pkpass')
      pass = double(pkpass: pkpass)
      allow(Dubai::Passbook::Pass).to receive(:new).with('directory').and_return(pass)

      get '/pass.pkpass'

      expect(last_response.body).to eq('your.pkpass')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dubai-0.2.0 spec/server_spec.rb