Sha256: 2bca1f89374324df06df7b4f2ac57d45fdf2ffa6263dd7cd5c4427d41e4d1ca0

Contents?: true

Size: 1001 Bytes

Versions: 16

Compression:

Stored size: 1001 Bytes

Contents

# -*- coding: utf-8 -*-
require 'helper'

class TestVortexClientUtils < Test::Unit::TestCase
  include Vortex

  def setup
    if(not(@vortex))
      user = ENV['DAVUSER']
      pass = ENV['DAVPASS']
      @vortex = Connection.new("https://vortex-dav.uio.no/",user, pass)
    end
  end

  should "publish articles" do
    url = 'https://vortex-dav.uio.no/brukere/thomasfl/nyheter/sample-title-2.html'
    if(@vortex.exists?(url))
      @vortex.delete(url)
    end

    @vortex.cd('/brukere/thomasfl/nyheter/')
    article = Vortex::HtmlArticle.new(:title => "Sample Title 2",
                                      :introduction => "Sample introduction",
                                      :body => "<p>Hello world</p>",
                                      ## :date => Time.now,
                                      :publishedDate => "05.01.2010 12:00",
                                      :author => "Thomas Flemming")

    @vortex.publish(article)
    assert @vortex.exists?(url)
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
vortex_client-0.7.3 test/test_vortex_article_publish.rb
vortex_client-0.7.2 test/test_vortex_article_publish.rb
vortex_client-0.7.0 test/test_vortex_article_publish.rb
vortex_client-0.5.9 test/test_vortex_article_publish.rb
vortex_client-0.5.8 test/test_vortex_article_publish.rb
vortex_client-0.5.6 test/test_vortex_article_publish.rb
vortex_client-0.5.5 test/test_vortex_article_publish.rb
vortex_client-0.5.4 test/test_vortex_article_publish.rb
vortex_client-0.5.3 test/test_vortex_article_publish.rb
vortex_client-0.5.2 test/test_vortex_article_publish.rb
vortex_client-0.5.1 test/test_vortex_article_publish.rb
vortex_client-0.5.0 test/test_vortex_article_publish.rb
vortex_client-0.4.0 test/test_vortex_article_publish.rb
vortex_client-0.3.1 test/test_vortex_article_publish.rb
vortex_client-0.3.0 test/test_vortex_article_publish.rb
vortex_client-0.2.0 test/test_vortex_article_publish.rb