Sha256: fda39b803ad19d09a64da6cee1a7eb4b60894c3bf81e75986c825b862b7892c3

Contents?: true

Size: 947 Bytes

Versions: 5

Compression:

Stored size: 947 Bytes

Contents

require File.expand_path('../../test_helper', __FILE__)

class PublisherTest < ActiveModel::TestCase
  # include ActiveModel::Lint::Tests

  class Fauna::Publisher
    field :visited
  end

  def setup
    super
    @model = Fauna::Publisher.find
    @attributes = {:visited => true}
  end

  def test_create
    assert_raises(Fauna::Invalid) do
      Fauna::Publisher.create
    end
  end

  def test_save
    publisher = Fauna::Publisher.new
    assert !publisher.persisted?
    assert_raises(Fauna::Invalid) do
      publisher.save
    end

    publisher = Fauna::Publisher.find
    publisher.save
  end

  def test_update
    Fauna::Publisher.find.update(@attributes)
    assert_equal true, Fauna::Publisher.find.visited
  end

  def test_find
    publisher = Fauna::Publisher.find
    assert_equal "publisher", publisher.ref
  end

  def test_destroy
    assert_raises(Fauna::Invalid) do
      Fauna::Publisher.find.destroy
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fauna-0.2.3 test/model/publisher_test.rb
fauna-0.2.2 test/model/publisher_test.rb
fauna-0.1.2 test/model/publisher_test.rb
fauna-0.1.1 test/model/publisher_test.rb
fauna-0.1 test/model/publisher_test.rb