Sha256: ea9fc898e7663342762eb1ee082f83ca51638853414ff56eaf1ddd6dc8db2b42

Contents?: true

Size: 1.11 KB

Versions: 8

Compression:

Stored size: 1.11 KB

Contents

require File.join(File.dirname(__FILE__),'..','spec_helper')
require 'rack/test'
require 'spec'
require 'spec/autorun'
require 'spec/interop/test'

require File.join(File.dirname(__FILE__),'..','..','lib','rhosync','server.rb')

describe "ApiHelper", :shared => true do
  it_should_behave_like "RhosyncDataHelper"

  include Rack::Test::Methods
  include Rhosync
  
  before(:each) do
    require File.join(get_testapp_path,@test_app_name)
    Rhosync.bootstrap(get_testapp_path) do |rhosync|
      rhosync.vendor_directory = File.join(rhosync.base_directory,'..','..','..','vendor')
    end
    Server.set( 
      :environment => :test,
      :run => false,
      :secret => "secure!"
    )
    @api_token = User.load('admin').token_id
  end

  def app
    @app ||= Server.new
  end

  it_should_behave_like "DBObjectsHelper"
end

def compress(path)
  path.sub!(%r[/$],'')
  archive = File.join(path,File.basename(path))+'.zip'
  FileUtils.rm archive, :force=>true
  Zip::ZipFile.open(archive, 'w') do |zipfile|
    Dir["#{path}/**/**"].reject{|f|f==archive}.each do |file|
      zipfile.add(file.sub(path+'/',''),file)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rhosync-2.0.0.beta9 spec/api/api_helper.rb
rhosync-2.0.0.beta8 spec/api/api_helper.rb
rhosync-2.0.0.beta7 spec/api/api_helper.rb
rhosync-2.0.0.beta6 spec/api/api_helper.rb
rhosync-2.0.0.beta4 spec/api/api_helper.rb
rhosync-2.0.0.beta3 spec/api/api_helper.rb
rhosync-2.0.0.beta2 spec/api/api_helper.rb
rhosync-2.0.0.beta1 spec/api/api_helper.rb