Sha256: 3eb1f2f2112c4ae1f5774594a1fa7994f45ec9af21d198b448379ddc0aefb48f

Contents?: true

Size: 1.21 KB

Versions: 10

Compression:

Stored size: 1.21 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
    Rhosync::Server.set :environment, :test
    Rhosync::Server.set :run, false
    Rhosync::Server.set :secret, "secure!"
    @api_token = User.load('rhoadmin').token_id
  end

  def app
    Rhosync::Server.set :stats, false
    Rhosync.stats = false
    @app ||= Rhosync::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.1.18.beta2 spec/api/api_helper.rb
rhosync-2.1.18.beta1 spec/api/api_helper.rb
rhosync-2.1.17 spec/api/api_helper.rb
rhosync-2.1.17.beta7 spec/api/api_helper.rb
rhosync-2.1.17.beta6 spec/api/api_helper.rb
rhosync-2.1.17.beta5 spec/api/api_helper.rb
rhosync-2.1.17.beta4 spec/api/api_helper.rb
rhosync-2.1.17.beta3 spec/api/api_helper.rb
rhosync-2.1.17.beta2 spec/api/api_helper.rb
rhosync-2.1.17.beta1 spec/api/api_helper.rb