Sha256: 1bbec9cd410ed3e8e2be107a55bb53d5618e292502a9252eb5e3a7e5ff91b21a

Contents?: true

Size: 1.12 KB

Versions: 10

Compression:

Stored size: 1.12 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('rhoadmin').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

10 entries across 10 versions & 1 rubygems

Version Path
rhosync-2.0.3 spec/api/api_helper.rb
rhosync-2.0.2 spec/api/api_helper.rb
rhosync-2.0.1 spec/api/api_helper.rb
rhosync-2.0.0 spec/api/api_helper.rb
rhosync-2.0.0.rc2 spec/api/api_helper.rb
rhosync-2.0.0.rc1 spec/api/api_helper.rb
rhosync-2.0.0.beta13 spec/api/api_helper.rb
rhosync-2.0.0.beta12 spec/api/api_helper.rb
rhosync-2.0.0.beta11 spec/api/api_helper.rb
rhosync-2.0.0.beta10 spec/api/api_helper.rb